From 5d8d3b85bd8b0c194c1fd05b25d05dc40f1b4fce Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Tue, 29 Mar 2016 09:28:36 -0700 Subject: [PATCH] addressed PR feedback --- src/compiler/printer.ts | 1 + src/compiler/transformers/es6.ts | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/compiler/printer.ts b/src/compiler/printer.ts index b55b302a9ce..520ec004d79 100644 --- a/src/compiler/printer.ts +++ b/src/compiler/printer.ts @@ -1759,6 +1759,7 @@ const _super = (function (geti, seti) { nodeIsSynthesized(statements[0]) || rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile) ); + if (emitAsSingleStatement) { write(" "); emit(statements[0]); diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index df023dcb50f..d4456c971c0 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -111,7 +111,7 @@ namespace ts { thisName?: Identifier; /* - * set to true if node contains lexical 'this' so we can mark function that wraps convered loop body as 'CapturedThis' for subsequence substitution. + * set to true if node contains lexical 'this' so we can mark function that wraps convered loop body as 'CapturedThis' for subsequent substitution. */ containsLexicalThis?: boolean; @@ -445,7 +445,7 @@ namespace ts { Debug.assert(convertedLoopState !== undefined); if (useCapturedThis) { - // if useCapturedThis is true then 'this' keyword is contained inside the arrow function. + // if useCapturedThis is true then 'this' keyword is contained inside an arrow function. convertedLoopState.containsLexicalThis = true; return node; } @@ -467,10 +467,10 @@ namespace ts { function visitBreakOrContinueStatement(node: BreakOrContinueStatement): Statement { if (convertedLoopState) { - // check if we can emit break\continue as is + // check if we can emit break/continue as is // it is possible if either - // - break\continue is labeled and label is located inside the converted loop - // - break\continue is non-labeled and located in non-converted loop\switch statement + // - break/continue is labeled and label is located inside the converted loop + // - break/continue is non-labeled and located in non-converted loop/switch statement const jump = node.kind === SyntaxKind.BreakStatement ? Jump.Break : Jump.Continue; const canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels[node.label.text]) ||