refactor: simplify arrow functions (#12057)

This commit is contained in:
Victor Berchet
2016-10-04 15:57:37 -07:00
committed by Chuck Jazdzewski
parent a63359689f
commit 50c37d45dc
25 changed files with 43 additions and 51 deletions

View File

@ -400,7 +400,7 @@ export abstract class AbstractEmitterVisitor implements o.StatementVisitor, o.Ex
}
visitAllStatements(statements: o.Statement[], ctx: EmitterVisitorContext): void {
statements.forEach((stmt) => { return stmt.visitStatement(this, ctx); });
statements.forEach((stmt) => stmt.visitStatement(this, ctx));
}
}

View File

@ -16,7 +16,7 @@ var CAMEL_CASE_REGEXP = /([A-Z])/g;
export function camelCaseToDashCase(input: string): string {
return StringWrapper.replaceAllMapped(
input, CAMEL_CASE_REGEXP, (m: string[]) => { return '-' + m[1].toLowerCase(); });
input, CAMEL_CASE_REGEXP, (m: string[]) => '-' + m[1].toLowerCase());
}
export function splitAtColon(input: string, defaultValues: string[]): string[] {

View File

@ -101,9 +101,8 @@ function createQueryValues(viewValues: ViewQueryValues): o.Expression[] {
function mapNestedViews(
declarationAppElement: o.Expression, view: CompileView,
expressions: o.Expression[]): o.Expression {
var adjustedExpressions: o.Expression[] = expressions.map((expr) => {
return o.replaceVarInExpression(o.THIS_EXPR.name, o.variable('nestedView'), expr);
});
var adjustedExpressions: o.Expression[] = expressions.map(
(expr) => o.replaceVarInExpression(o.THIS_EXPR.name, o.variable('nestedView'), expr));
return declarationAppElement.callMethod('mapNestedViews', [
o.variable(view.className),
o.fn(