diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index e57e367544f..8e0e95ce45b 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3292,16 +3292,17 @@ module ts { function emitSignatureParametersForArrow(node: FunctionLikeDeclaration) { // Check whether the parameter list needs parentheses and preserve no-parenthesis - if (node.flags & NodeFlags.SimpleArrowFunction) { - increaseIndent(); - var parameters = node.parameters; - var omitCount = hasRestParameters(node) ? 1 : 0; - emitList(parameters, 0, parameters.length - omitCount, /*multiLine*/ false, /*trailingComma*/ false); - decreaseIndent(); - } - else { - emitSignatureParameters(node); + if (node.parameters.length === 1){ + if (node.pos === node.parameters[0].pos) { + increaseIndent(); + var parameters = node.parameters; + var omitCount = hasRestParameters(node) ? 1 : 0; + emitList(parameters, 0, parameters.length - omitCount, /*multiLine*/ false, /*trailingComma*/ false); + decreaseIndent(); + return; + } } + emitSignatureParameters(node); } function emitSignatureAndBody(node: FunctionLikeDeclaration) { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 82fa5f2c579..5ae44e5ff39 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2883,9 +2883,6 @@ module ts { node.parameters = >[parameter]; node.parameters.pos = parameter.pos; node.parameters.end = parameter.end; - // Add node flags for simple arrow function(no parenthesis around parameters) - // so that in emit state we can check this flag and preserve users original text - node.flags |= NodeFlags.SimpleArrowFunction; parseExpected(SyntaxKind.EqualsGreaterThanToken); node.body = parseArrowFunctionExpressionBody(); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 2dd14d079a6..80bdc875177 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -293,8 +293,6 @@ module ts { Const = 0x00001000, // Variable declaration OctalLiteral = 0x00002000, - SimpleArrowFunction = 0x00004000, // Arrow function without parenthesized parameters - Modifier = Export | Ambient | Public | Private | Protected | Static, AccessibilityModifier = Public | Private | Protected, BlockScoped = Let | Const