From c8691a189c7b136ceb3fce83c0ac1acc5ea25b4b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 5 Feb 2015 13:57:27 -0800 Subject: [PATCH] Add newline before closing paren in multiline object literals. --- src/compiler/emitter.ts | 77 ++++++++++--------- .../reference/computedPropertyNames10_ES5.js | 3 +- .../reference/computedPropertyNames11_ES5.js | 25 +++--- .../reference/computedPropertyNames18_ES5.js | 3 +- .../reference/computedPropertyNames19_ES5.js | 3 +- .../reference/computedPropertyNames1_ES5.js | 7 +- .../reference/computedPropertyNames20_ES5.js | 3 +- .../reference/computedPropertyNames22_ES5.js | 3 +- .../reference/computedPropertyNames25_ES5.js | 3 +- .../reference/computedPropertyNames28_ES5.js | 3 +- .../reference/computedPropertyNames29_ES5.js | 3 +- .../reference/computedPropertyNames30_ES5.js | 3 +- .../reference/computedPropertyNames31_ES5.js | 3 +- .../reference/computedPropertyNames33_ES5.js | 3 +- .../reference/computedPropertyNames34_ES5.js | 3 +- .../reference/computedPropertyNames46_ES5.js | 3 +- .../reference/computedPropertyNames47_ES5.js | 3 +- .../reference/computedPropertyNames48_ES5.js | 9 ++- .../reference/computedPropertyNames4_ES5.js | 3 +- .../reference/computedPropertyNames5_ES5.js | 3 +- .../reference/computedPropertyNames6_ES5.js | 3 +- .../reference/computedPropertyNames7_ES5.js | 3 +- .../reference/computedPropertyNames8_ES5.js | 3 +- .../reference/computedPropertyNames9_ES5.js | 3 +- ...mputedPropertyNamesContextualType10_ES5.js | 3 +- ...omputedPropertyNamesContextualType1_ES5.js | 3 +- ...omputedPropertyNamesContextualType2_ES5.js | 3 +- ...omputedPropertyNamesContextualType3_ES5.js | 3 +- ...omputedPropertyNamesContextualType4_ES5.js | 3 +- ...omputedPropertyNamesContextualType5_ES5.js | 3 +- ...omputedPropertyNamesContextualType6_ES5.js | 3 +- ...omputedPropertyNamesContextualType7_ES5.js | 3 +- ...omputedPropertyNamesContextualType8_ES5.js | 3 +- ...omputedPropertyNamesContextualType9_ES5.js | 3 +- ...mputedPropertyNamesDeclarationEmit5_ES5.js | 7 +- .../computedPropertyNamesSourceMap2_ES5.js | 3 +- ...computedPropertyNamesSourceMap2_ES5.js.map | 2 +- ...dPropertyNamesSourceMap2_ES5.sourcemap.txt | 35 +++++---- .../parserES5ComputedPropertyName4.js | 3 +- tests/baselines/reference/privateIndexer2.js | 3 +- 40 files changed, 152 insertions(+), 109 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index e6f3a08453e..16eea07ef4e 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -195,7 +195,7 @@ module ts { // } // module m { // /* this is line 1 -- Assume current writer indent 8 - // * line --3 = 8 - 4 + 5 + // * line --3 = 8 - 4 + 5 // More right indented comment */ --4 = 8 - 4 + 11 // class c { } // } @@ -359,8 +359,8 @@ module ts { var aliasDeclarationEmitInfo: AliasDeclarationEmitInfo[] = []; - // Contains the reference paths that needs to go in the declaration file. - // Collecting this separately because reference paths need to be first thing in the declaration file + // Contains the reference paths that needs to go in the declaration file. + // Collecting this separately because reference paths need to be first thing in the declaration file // and we could be collecting these paths from multiple files into single one with --out option var referencePathsOutput = ""; @@ -467,7 +467,7 @@ module ts { // Eg. // export function bar(a: foo.Foo) { } // import foo = require("foo"); - // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, + // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (aliasEmitInfo) { createAndSetNewTextWriterWithSymbolWriter(); @@ -608,7 +608,7 @@ module ts { } function emitEntityName(entityName: EntityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, + var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration entityName.parent.kind === SyntaxKind.ImportDeclaration ? entityName.parent : enclosingDeclaration); @@ -692,7 +692,7 @@ module ts { function emitModuleElementDeclarationFlags(node: Node) { // If the node is parented in the current source file we need to emit export declare or just export if (node.parent === currentSourceFile) { - // If the node is exported + // If the node is exported if (node.flags & NodeFlags.Export) { write("export "); } @@ -730,7 +730,7 @@ module ts { } function writeImportDeclaration(node: ImportDeclaration) { - // note usage of writer. methods instead of aliases created, just to make sure we are using + // note usage of writer. methods instead of aliases created, just to make sure we are using // correct writer especially to handle asynchronous alias writing emitJsDocComments(node); if (node.flags & NodeFlags.Export) { @@ -1083,7 +1083,7 @@ module ts { } function emitTypeOfVariableDeclarationFromTypeLiteral(node: VariableLikeDeclaration) { - // if this is property of type literal, + // if this is property of type literal, // or is parameter of method/call/construct/index signature of type literal // emit only if type is specified if (node.type) { @@ -1496,7 +1496,7 @@ module ts { referencePathsOutput += "/// " + newLine; } } - + export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, targetSourceFile: SourceFile): Diagnostic[] { var diagnostics: Diagnostic[] = []; var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); @@ -1557,7 +1557,7 @@ module ts { var emitEnd = function (node: Node) { }; /** Emit the text for the given token that comes after startPos - * This by default writes the text provided with the given tokenKind + * This by default writes the text provided with the given tokenKind * but if optional emitFn callback is provided the text is emitted using the callback instead of default text * @param tokenKind the kind of the token to search and emit * @param startPos the position in the source to start searching for the token @@ -1624,13 +1624,13 @@ module ts { // 1. Relative Column 0 based sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); - // 2. Relative sourceIndex + // 2. Relative sourceIndex sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); // 3. Relative sourceLine 0 based sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); - // 4. Relative sourceColumn 0 based + // 4. Relative sourceColumn 0 based sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); // 5. Relative namePosition 0 based @@ -1730,7 +1730,7 @@ module ts { function recordNewSourceFileStart(node: SourceFile) { // Add the file to tsFilePaths - // If sourceroot option: Use the relative path corresponding to the common directory path + // If sourceroot option: Use the relative path corresponding to the common directory path // otherwise source locations relative to map file location var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; @@ -1870,7 +1870,7 @@ module ts { sourceMapDecodedMappings: [] }; - // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the + // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the // relative paths of the sources list in the sourcemap sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== CharacterCodes.slash) { @@ -2186,10 +2186,10 @@ module ts { // All binary expressions have lower precedence than '+' apart from '*', '/', and '%' // which have greater precedence and '-' which has equal precedence. // All unary operators have a higher precedence apart from yield. - // Arrow functions and conditionals have a lower precedence, + // Arrow functions and conditionals have a lower precedence, // although we convert the former into regular function expressions in ES5 mode, // and in ES6 mode this function won't get called anyway. - // + // // TODO (drosen): Note that we need to account for the upcoming 'yield' and // spread ('...') unary operators that are anticipated for ES6. switch (expression.kind) { @@ -2438,29 +2438,29 @@ module ts { write("}"); } - + function emitDownlevelObjectLiteralWithComputedProperties(node: ObjectLiteralExpression, firstComputedPropertyIndex: number) { var multiLine = (node.flags & NodeFlags.MultiLine) !== 0; var properties = node.properties; - + write("("); // For computed properties, we need to create a unique handle to the object // literal so we can modify it without risking internal assignments tainting the object. var tempVar = createTempVariable(node); recordTempDeclaration(tempVar); - + // Write out the first non-computed properties // (or all properties if none of them are computed), // then emit the rest through indexing on the temp variable. emit(tempVar) write(" = "); emitObjectLiteralBody(node, firstComputedPropertyIndex); - + if (multiLine) { increaseIndent(); } - + for (var i = firstComputedPropertyIndex, n = properties.length; i < n; i++) { writeSeparator(); @@ -2505,7 +2505,7 @@ module ts { writeLine(); write("configurable: true"); decreaseIndent(); - writeSeparator(); + writeLine(); write("})"); emitEnd(property); } @@ -2515,7 +2515,7 @@ module ts { emit(tempVar); emitMemberAccessForPropertyName(property.name); emitEnd(property.name); - + write(" = "); if (property.kind === SyntaxKind.PropertyAssignment) { @@ -2531,19 +2531,20 @@ module ts { Debug.fail("ObjectLiteralElement type not accounted for: " + property.kind); } } - + emitEnd(property); } - + writeSeparator(); emit(tempVar); - - write(")"); if (multiLine) { decreaseIndent(); + writeLine(); } - + + write(")"); + function writeSeparator() { if (multiLine) { write(","); @@ -2706,7 +2707,7 @@ module ts { var operand = (node.expression).expression; // Make sure we consider all nested cast expressions, e.g.: - // (-A).x; + // (-A).x; while (operand.kind == SyntaxKind.TypeAssertionExpression) { operand = (operand).expression; } @@ -2714,7 +2715,7 @@ module ts { // We have an expression of the form: (SubExpr) // Emitting this as (SubExpr) is really not desirable. We would like to emit the subexpr as is. // Omitting the parentheses, however, could cause change in the semantics of the generated - // code if the casted expression has a lower precedence than the rest of the expression, e.g.: + // code if the casted expression has a lower precedence than the rest of the expression, e.g.: // (new A).foo should be emitted as (new A).foo and not new A.foo // (typeof A).toString() should be emitted as (typeof A).toString() and not typeof A.toString() // new (A()) should be emitted as new (A()) and not new A() @@ -3507,7 +3508,7 @@ module ts { emitStart(node.body); write("return "); - // Don't emit comments on this body. We'll have already taken care of it above + // Don't emit comments on this body. We'll have already taken care of it above // when we called emitDetachedComments. emitNode(node.body, /*disableComments:*/ true); emitEnd(node.body); @@ -4207,12 +4208,12 @@ module ts { return false; case SyntaxKind.ModuleDeclaration: - // Only emit the leading/trailing comments for a module if we're actually + // Only emit the leading/trailing comments for a module if we're actually // emitting the module as well. return shouldEmitModuleDeclaration(node); case SyntaxKind.EnumDeclaration: - // Only emit the leading/trailing comments for an enum if we're actually + // Only emit the leading/trailing comments for an enum if we're actually // emitting the module as well. return shouldEmitEnumDeclaration(node); } @@ -4436,7 +4437,7 @@ module ts { } emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); + emitComments(currentSourceFile, writer, leadingComments, /*trailingSeparator*/ true, newLine, writeComment); } function emitDetachedCommentsAtPosition(node: TextRange) { @@ -4452,7 +4453,7 @@ module ts { if (commentLine >= lastCommentLine + 2) { // There was a blank line between the last comment and this comment. This - // comment is not part of the copyright comments. Return what we have so + // comment is not part of the copyright comments. Return what we have so // far. return detachedComments; } @@ -4491,7 +4492,7 @@ module ts { if (currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk) { return currentSourceFile.text.charCodeAt(comment.pos + 2) === CharacterCodes.exclamation; } - // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text + // Verify this is /// comment, but do the regexp match only when we first can find /// in the comment text // so that we don't end up computing comment string and doing match for all // comments else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === CharacterCodes.slash && comment.pos + 2 < comment.end && @@ -4527,7 +4528,7 @@ module ts { function writeDeclarationFile(jsFilePath: string, sourceFile: SourceFile) { var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); - // TODO(shkamat): Should we not write any declaration file if any of them can produce error, + // TODO(shkamat): Should we not write any declaration file if any of them can produce error, // or should we just not write this file like we are doing now if (!emitDeclarationResult.reportedDeclarationError) { var declarationOutput = emitDeclarationResult.referencePathsOutput; @@ -4587,7 +4588,7 @@ module ts { emitFile(compilerOptions.out); } } - + function emitFile(jsFilePath: string, sourceFile?: SourceFile) { if (!isEmitBlocked) { emitJavaScript(jsFilePath, sourceFile); diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.js b/tests/baselines/reference/computedPropertyNames10_ES5.js index 5d8ff398d6c..808fc46d8d7 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.js +++ b/tests/baselines/reference/computedPropertyNames10_ES5.js @@ -43,5 +43,6 @@ var v = (_a = {}, }, _a["hello " + a + " bye"] = function () { }, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.js b/tests/baselines/reference/computedPropertyNames11_ES5.js index 7005e392748..548b25d31d4 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.js +++ b/tests/baselines/reference/computedPropertyNames11_ES5.js @@ -26,72 +26,73 @@ var v = (_a = {}, return 0; }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, n, { set: function (v) { }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, s + s, { get: function () { return 0; }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, s + n, { set: function (v) { }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, +s, { get: function () { return 0; }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, "", { set: function (v) { }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, 0, { get: function () { return 0; }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, a, { set: function (v) { }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, true, { get: function () { return 0; }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, "hello bye", { set: function (v) { }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, "hello " + a + " bye", { get: function () { return 0; }, enumerable: true, - configurable: true, + configurable: true }), - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.js b/tests/baselines/reference/computedPropertyNames18_ES5.js index a62af506531..b65c7fd4f7d 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5.js +++ b/tests/baselines/reference/computedPropertyNames18_ES5.js @@ -9,6 +9,7 @@ function foo() { function foo() { var obj = (_a = {}, _a[this.bar] = 0, - _a); + _a + ); var _a; } diff --git a/tests/baselines/reference/computedPropertyNames19_ES5.js b/tests/baselines/reference/computedPropertyNames19_ES5.js index bda3e01bbed..36f3e66c7c2 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5.js +++ b/tests/baselines/reference/computedPropertyNames19_ES5.js @@ -10,6 +10,7 @@ var M; (function (M) { var obj = (_a = {}, _a[this.bar] = 0, - _a); + _a + ); var _a; })(M || (M = {})); diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.js b/tests/baselines/reference/computedPropertyNames1_ES5.js index 5e630a5b81d..c3e7f8aa8d5 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5.js +++ b/tests/baselines/reference/computedPropertyNames1_ES5.js @@ -11,14 +11,15 @@ var v = (_a = {}, return 0; }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, 0 + 1, { set: function (v) { } //No error , enumerable: true, - configurable: true, + configurable: true }), - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.js b/tests/baselines/reference/computedPropertyNames20_ES5.js index 1eec0a7bcdb..65acd7fa08f 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5.js +++ b/tests/baselines/reference/computedPropertyNames20_ES5.js @@ -6,5 +6,6 @@ var obj = { //// [computedPropertyNames20_ES5.js] var obj = (_a = {}, _a[this.bar] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.js b/tests/baselines/reference/computedPropertyNames22_ES5.js index b28e0ea68e2..67edf62dfd7 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5.js +++ b/tests/baselines/reference/computedPropertyNames22_ES5.js @@ -16,7 +16,8 @@ var C = (function () { var obj = (_a = {}, _a[this.bar()] = function () { }, - _a); + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.js b/tests/baselines/reference/computedPropertyNames25_ES5.js index 4bcf877c571..f6a5ce2a9ce 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.js +++ b/tests/baselines/reference/computedPropertyNames25_ES5.js @@ -37,7 +37,8 @@ var C = (function (_super) { var obj = (_a = {}, _a[_super.prototype.bar.call(this)] = function () { }, - _a); + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.js b/tests/baselines/reference/computedPropertyNames28_ES5.js index 418252784a2..1ff9ac7e65e 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -29,7 +29,8 @@ var C = (function (_super) { var obj = (_a = {}, _a[(_super.call(this), "prop")] = function () { }, - _a); + _a + ); var _a; } return C; diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.js b/tests/baselines/reference/computedPropertyNames29_ES5.js index 93a80128d98..bcc32205b80 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5.js +++ b/tests/baselines/reference/computedPropertyNames29_ES5.js @@ -20,7 +20,8 @@ var C = (function () { var obj = (_a = {}, _a[_this.bar()] = function () { }, - _a); + _a + ); var _a; }); return 0; diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index 30d314f1f6a..7a88d43263a 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -38,7 +38,8 @@ var C = (function (_super) { //treatment of other similar violations. _a[(_super.call(this), "prop")] = function () { }, - _a); + _a + ); var _a; }); } diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.js b/tests/baselines/reference/computedPropertyNames31_ES5.js index a079b3fa449..9c0c888b3bf 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.js +++ b/tests/baselines/reference/computedPropertyNames31_ES5.js @@ -41,7 +41,8 @@ var C = (function (_super) { var obj = (_a = {}, _a[_super.prototype.bar.call(_this)] = function () { }, - _a); + _a + ); var _a; }); return 0; diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.js b/tests/baselines/reference/computedPropertyNames33_ES5.js index 24362351196..9768383f320 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5.js +++ b/tests/baselines/reference/computedPropertyNames33_ES5.js @@ -20,7 +20,8 @@ var C = (function () { var obj = (_a = {}, _a[foo()] = function () { }, - _a); + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames34_ES5.js b/tests/baselines/reference/computedPropertyNames34_ES5.js index 83e757222b0..be1a06b81d1 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES5.js +++ b/tests/baselines/reference/computedPropertyNames34_ES5.js @@ -20,7 +20,8 @@ var C = (function () { var obj = (_a = {}, _a[foo()] = function () { }, - _a); + _a + ); return 0; var _a; }; diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.js b/tests/baselines/reference/computedPropertyNames46_ES5.js index 815f5769f3b..307dadcbe91 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5.js +++ b/tests/baselines/reference/computedPropertyNames46_ES5.js @@ -6,5 +6,6 @@ var o = { //// [computedPropertyNames46_ES5.js] var o = (_a = {}, _a["" || 0] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.js b/tests/baselines/reference/computedPropertyNames47_ES5.js index 7d839e16ffb..6ba31fe3b06 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5.js +++ b/tests/baselines/reference/computedPropertyNames47_ES5.js @@ -16,5 +16,6 @@ var E2; })(E2 || (E2 = {})); var o = (_a = {}, _a[0 /* x */ || 0 /* x */] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.js b/tests/baselines/reference/computedPropertyNames48_ES5.js index c5ca0d5b241..859fb7a179c 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5.js +++ b/tests/baselines/reference/computedPropertyNames48_ES5.js @@ -25,11 +25,14 @@ var E; var a; extractIndexer((_a = {}, _a[a] = "", - _a)); // Should return string + _a +)); // Should return string extractIndexer((_b = {}, _b[0 /* x */] = "", - _b)); // Should return string + _b +)); // Should return string extractIndexer((_c = {}, _c["" || 0] = "", - _c)); // Should return any (widened form of undefined) + _c +)); // Should return any (widened form of undefined) var _a, _b, _c; diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.js b/tests/baselines/reference/computedPropertyNames4_ES5.js index ac0fa8ec937..f91476c79c1 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.js +++ b/tests/baselines/reference/computedPropertyNames4_ES5.js @@ -32,5 +32,6 @@ var v = (_a = {}, _a[true] = 0, _a["hello bye"] = 0, _a["hello " + a + " bye"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames5_ES5.js b/tests/baselines/reference/computedPropertyNames5_ES5.js index 3367faa2c20..58c5af2efa3 100644 --- a/tests/baselines/reference/computedPropertyNames5_ES5.js +++ b/tests/baselines/reference/computedPropertyNames5_ES5.js @@ -18,5 +18,6 @@ var v = (_a = {}, _a[{}] = 0, _a[undefined] = undefined, _a[null] = null, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames6_ES5.js b/tests/baselines/reference/computedPropertyNames6_ES5.js index 29d035bfcbf..7e9c6202940 100644 --- a/tests/baselines/reference/computedPropertyNames6_ES5.js +++ b/tests/baselines/reference/computedPropertyNames6_ES5.js @@ -16,5 +16,6 @@ var v = (_a = {}, _a[p1] = 0, _a[p2] = 1, _a[p3] = 2, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.js b/tests/baselines/reference/computedPropertyNames7_ES5.js index 9c23dcab20d..886cd8d85eb 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5.js +++ b/tests/baselines/reference/computedPropertyNames7_ES5.js @@ -13,5 +13,6 @@ var E; })(E || (E = {})); var v = (_a = {}, _a[0 /* member */] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNames8_ES5.js b/tests/baselines/reference/computedPropertyNames8_ES5.js index 82d262c7e4e..6eceee81adb 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES5.js +++ b/tests/baselines/reference/computedPropertyNames8_ES5.js @@ -15,6 +15,7 @@ function f() { var v = (_a = {}, _a[t] = 0, _a[u] = 1, - _a); + _a + ); var _a; } diff --git a/tests/baselines/reference/computedPropertyNames9_ES5.js b/tests/baselines/reference/computedPropertyNames9_ES5.js index 1b4fa16de2d..705948f8613 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES5.js +++ b/tests/baselines/reference/computedPropertyNames9_ES5.js @@ -17,5 +17,6 @@ var v = (_a = {}, _a[f("")] = 0, _a[f(0)] = 0, _a[f(true)] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js index d8a33951d4a..1f7a3ae123e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js @@ -12,5 +12,6 @@ var o: I = { var o = (_a = {}, _a[+"foo"] = "", _a[+"bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js index e79d8c82df8..844e498bdf6 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js @@ -15,5 +15,6 @@ var o = (_a = {}, return y.length; }, _a["" + 1] = function (y) { return y.length; }, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js index 30085fe8366..b047b4ad1ba 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js @@ -15,5 +15,6 @@ var o = (_a = {}, return y.length; }, _a[+"bar"] = function (y) { return y.length; }, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js index 02f8702bd6a..7083d7d52e7 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js @@ -14,5 +14,6 @@ var o = (_a = {}, return y.length; }, _a[+"bar"] = function (y) { return y.length; }, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js index 0c319a526f4..b17f91be38b 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a["" + "foo"] = "", _a["" + "bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js index 51d78be59d4..c7a728e5ef8 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a[+"foo"] = "", _a[+"bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js index f11e5e4a5bb..eb2926b832d 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js @@ -22,5 +22,6 @@ foo((_a = { _a["hi" + "bye"] = true, _a[0 + 1] = 0, _a[+"hi"] = [0], - _a)); + _a +)); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js index 0b15794e577..7461de7537d 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js @@ -22,5 +22,6 @@ foo((_a = { _a["hi" + "bye"] = true, _a[0 + 1] = 0, _a[+"hi"] = [0], - _a)); + _a +)); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js index 24f6218864c..419ea906550 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a["" + "foo"] = "", _a["" + "bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js index 340802da2af..d3beb8b8deb 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js @@ -13,5 +13,6 @@ var o: I = { var o = (_a = {}, _a[+"foo"] = "", _a[+"bar"] = 0, - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js index 38161f1573e..82f8e41ff26 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js @@ -16,15 +16,16 @@ var v = (_a = {}, return 0; }, enumerable: true, - configurable: true, + configurable: true }), Object.defineProperty(_a, "" + "", { set: function (x) { }, enumerable: true, - configurable: true, + configurable: true }), - _a); + _a +); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js index 972aaf9b52f..39e393c46cc 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js @@ -10,6 +10,7 @@ var v = (_a = {}, _a["hello"] = function () { debugger; }, - _a); + _a +); var _a; //# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map index 01cb2673516..2d9d4ea3088 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap2_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":["[\"hello\"]"],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAR,EAAA;IACI,AADJ,EAAA,CACK,OAAO,CAAC;QACLA,QAAQA,CAACA;IACbA,CAACA;IAHL,EAAA,CAIC,CAAA;IAJD,EAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":["[\"hello\"]"],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAR,EAAA;IACI,AADJ,EAAA,CACK,OAAO,CAAC;QACLA,QAAQA,CAACA;IACbA,CAACA;IAHL,EAAA;CAIC,CAAA;IAJD,EAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt index b8e1e073b08..4c49c91499b 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt @@ -67,38 +67,41 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts >>> }, 1 >^^^^ 2 > ^ -3 > ^^^^-> +3 > ^^-> 1 > > 2 > } 1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) name (["hello"]) 2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) name (["hello"]) --- ->>> _a); +>>> _a 1->^^^^ 2 > ^^ -3 > ^ -4 > ^ 1-> 2 > -3 > var v = { - > ["hello"]() { - > debugger; - > } - > } -4 > 1->Emitted(5, 5) Source(1, 1) + SourceIndex(0) 2 >Emitted(5, 7) Source(1, 1) + SourceIndex(0) -3 >Emitted(5, 8) Source(5, 2) + SourceIndex(0) -4 >Emitted(5, 9) Source(5, 2) + SourceIndex(0) +--- +>>>); +1 >^ +2 > ^ +3 > ^^^^^^-> +1 >var v = { + > ["hello"]() { + > debugger; + > } + >} +2 > +1 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) +2 >Emitted(6, 3) Source(5, 2) + SourceIndex(0) --- >>>var _a; -1 >^^^^ +1->^^^^ 2 > ^^ 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > +1-> 2 > -1 >Emitted(6, 5) Source(1, 1) + SourceIndex(0) -2 >Emitted(6, 7) Source(1, 1) + SourceIndex(0) +1->Emitted(7, 5) Source(1, 1) + SourceIndex(0) +2 >Emitted(7, 7) Source(1, 1) + SourceIndex(0) --- >>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName4.js b/tests/baselines/reference/parserES5ComputedPropertyName4.js index b54a53993d6..dfa3473f29e 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName4.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName4.js @@ -6,5 +6,6 @@ var v = (_a = {}, Object.defineProperty(_a, e, { get: function () { }, enumerable: true, - configurable: true, }), _a); + configurable: true +}), _a); var _a; diff --git a/tests/baselines/reference/privateIndexer2.js b/tests/baselines/reference/privateIndexer2.js index a90e03a5bc2..1268c6e4c25 100644 --- a/tests/baselines/reference/privateIndexer2.js +++ b/tests/baselines/reference/privateIndexer2.js @@ -14,6 +14,7 @@ var y: { var x = (_a = {}, _a[x] = string, _a.string = , - _a); + _a +); var y; var _a;