From 71c3bccef4d6492ee3bdcd170d551376fcb5ef42 Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Thu, 26 Feb 2015 15:35:17 -0800 Subject: [PATCH] Produce better wrapping for object literal emit with computed property names. --- src/compiler/emitter.ts | 33 +++- .../baselines/reference/ES5SymbolProperty1.js | 4 +- .../reference/FunctionDeclaration8_es6.js | 4 +- .../reference/FunctionDeclaration9_es6.js | 4 +- .../FunctionPropertyAssignments5_es6.js | 3 +- .../reference/computedPropertyNames10_ES5.js | 13 +- .../reference/computedPropertyNames11_ES5.js | 13 +- .../reference/computedPropertyNames18_ES5.js | 4 +- .../reference/computedPropertyNames19_ES5.js | 4 +- .../reference/computedPropertyNames1_ES5.js | 4 +- .../reference/computedPropertyNames20_ES5.js | 4 +- .../reference/computedPropertyNames22_ES5.js | 3 +- .../reference/computedPropertyNames23_ES5.js | 4 +- .../reference/computedPropertyNames25_ES5.js | 3 +- .../reference/computedPropertyNames26_ES5.js | 4 +- .../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 | 4 +- .../reference/computedPropertyNames47_ES5.js | 4 +- .../reference/computedPropertyNames48_ES5.js | 12 +- .../reference/computedPropertyNames49_ES5.js | 30 ++-- .../reference/computedPropertyNames4_ES5.js | 24 +-- .../reference/computedPropertyNames50_ES5.js | 30 ++-- .../reference/computedPropertyNames5_ES5.js | 14 +- .../reference/computedPropertyNames6_ES5.js | 8 +- .../reference/computedPropertyNames7_ES5.js | 4 +- .../reference/computedPropertyNames8_ES5.js | 6 +- .../reference/computedPropertyNames9_ES5.js | 8 +- ...mputedPropertyNamesContextualType10_ES5.js | 6 +- ...omputedPropertyNamesContextualType1_ES5.js | 5 +- ...omputedPropertyNamesContextualType2_ES5.js | 5 +- ...omputedPropertyNamesContextualType3_ES5.js | 5 +- ...omputedPropertyNamesContextualType4_ES5.js | 6 +- ...omputedPropertyNamesContextualType5_ES5.js | 6 +- ...omputedPropertyNamesContextualType6_ES5.js | 12 +- ...omputedPropertyNamesContextualType7_ES5.js | 12 +- ...omputedPropertyNamesContextualType8_ES5.js | 6 +- ...omputedPropertyNamesContextualType9_ES5.js | 6 +- ...mputedPropertyNamesDeclarationEmit5_ES5.js | 7 +- .../computedPropertyNamesSourceMap2_ES5.js | 7 +- ...computedPropertyNamesSourceMap2_ES5.js.map | 2 +- ...dPropertyNamesSourceMap2_ES5.sourcemap.txt | 168 +++++++++--------- .../parserES5ComputedPropertyName2.js | 4 +- .../parserES5ComputedPropertyName3.js | 3 +- .../parserES5ComputedPropertyName4.js | 3 +- tests/baselines/reference/privateIndexer2.js | 6 +- 50 files changed, 299 insertions(+), 236 deletions(-) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index e57255a776b..0ded941b54c 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1523,6 +1523,10 @@ module ts { return diagnostics; } + interface SynthesizedNode extends Node { + startsOnNewLine: boolean; + } + // @internal // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult { @@ -2622,14 +2626,19 @@ module ts { } } - function createSynthesizedNode(kind: SyntaxKind): Node { - var node = createNode(kind); + function createSynthesizedNode(kind: SyntaxKind, startsOnNewLine?: boolean): Node { + var node = createNode(kind); node.pos = -1; node.end = -1; + node.startsOnNewLine = startsOnNewLine; return node; } + function isSynthesized(node: Node) { + return node.pos === -1 && node.end === -1; + } + function emitDownlevelObjectLiteralWithComputedProperties(node: ObjectLiteralExpression, firstComputedPropertyIndex: number): void { var parenthesizedObjectLiteral = createDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex); return emit(parenthesizedObjectLiteral); @@ -2663,7 +2672,7 @@ module ts { }); // Finally, return the temp variable. - propertyPatches = createBinaryExpression(propertyPatches, SyntaxKind.CommaToken, tempVar); + propertyPatches = createBinaryExpression(propertyPatches, SyntaxKind.CommaToken, createIdentifier(tempVar.text, /*startsOnNewLine:*/ true)); var result = createParenthesizedExpression(propertyPatches); @@ -2686,7 +2695,7 @@ module ts { var leftHandSide = createMemberAccessForPropertyName(tempVar, property.name); var maybeRightHandSide = tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral, property); - return maybeRightHandSide && createBinaryExpression(leftHandSide, SyntaxKind.EqualsToken, maybeRightHandSide); + return maybeRightHandSide && createBinaryExpression(leftHandSide, SyntaxKind.EqualsToken, maybeRightHandSide, /*startsOnNewLine:*/ true); } function tryGetRightHandSideOfPatchingPropertyAssignment(objectLiteral: ObjectLiteralExpression, property: ObjectLiteralElement) { @@ -2759,8 +2768,8 @@ module ts { return result; } - function createBinaryExpression(left: Expression, operator: SyntaxKind, right: Expression): BinaryExpression { - var result = createSynthesizedNode(SyntaxKind.BinaryExpression); + function createBinaryExpression(left: Expression, operator: SyntaxKind, right: Expression, startsOnNewLine?: boolean): BinaryExpression { + var result = createSynthesizedNode(SyntaxKind.BinaryExpression, startsOnNewLine); result.operatorToken = createSynthesizedNode(operator); result.left = left; result.right = right; @@ -2815,8 +2824,8 @@ module ts { return result; } - function createIdentifier(name: string) { - var result = createSynthesizedNode(SyntaxKind.Identifier); + function createIdentifier(name: string, startsOnNewLine?: boolean) { + var result = createSynthesizedNode(SyntaxKind.Identifier, startsOnNewLine); result.text = name; return result; @@ -3160,9 +3169,11 @@ module ts { write(tokenToString(node.operatorToken.kind)); + var shouldPlaceOnNewLine = !isSynthesized(node) && !nodeEndIsOnSameLineAsNodeStart(node.operatorToken, node.right); + // Check if the right expression is on a different line versus the operator itself. If so, // we'll emit newline. - if (!nodeEndIsOnSameLineAsNodeStart(node.operatorToken, node.right)) { + if (shouldPlaceOnNewLine || synthesizedNodeStartsOnNewLine(node.right)) { increaseIndent(); writeLine(); emit(node.right); @@ -3175,6 +3186,10 @@ module ts { } } + function synthesizedNodeStartsOnNewLine(node: Node) { + return isSynthesized(node) && (node).startsOnNewLine; + } + function emitConditionalExpression(node: ConditionalExpression) { emit(node.condition); write(" ? "); diff --git a/tests/baselines/reference/ES5SymbolProperty1.js b/tests/baselines/reference/ES5SymbolProperty1.js index 7d29658e286..ab3f420c95c 100644 --- a/tests/baselines/reference/ES5SymbolProperty1.js +++ b/tests/baselines/reference/ES5SymbolProperty1.js @@ -12,8 +12,8 @@ obj[Symbol.foo]; //// [ES5SymbolProperty1.js] var Symbol; -var obj = (_a = {}, _a[Symbol.foo] = - 0, +var obj = (_a = {}, + _a[Symbol.foo] = 0, _a); obj[Symbol.foo]; var _a; diff --git a/tests/baselines/reference/FunctionDeclaration8_es6.js b/tests/baselines/reference/FunctionDeclaration8_es6.js index acb336b6418..62692997a91 100644 --- a/tests/baselines/reference/FunctionDeclaration8_es6.js +++ b/tests/baselines/reference/FunctionDeclaration8_es6.js @@ -2,7 +2,7 @@ var v = { [yield]: foo } //// [FunctionDeclaration8_es6.js] -var v = (_a = {}, _a[yield] = - foo, +var v = (_a = {}, + _a[yield] = foo, _a); var _a; diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.js b/tests/baselines/reference/FunctionDeclaration9_es6.js index 9ecc0eb6d65..c63cf5bb458 100644 --- a/tests/baselines/reference/FunctionDeclaration9_es6.js +++ b/tests/baselines/reference/FunctionDeclaration9_es6.js @@ -5,8 +5,8 @@ function * foo() { //// [FunctionDeclaration9_es6.js] function foo() { - var v = (_a = {}, _a[] = - foo, + var v = (_a = {}, + _a[] = foo, _a); var _a; } diff --git a/tests/baselines/reference/FunctionPropertyAssignments5_es6.js b/tests/baselines/reference/FunctionPropertyAssignments5_es6.js index 6a20d4aff03..51e5d0000e4 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments5_es6.js +++ b/tests/baselines/reference/FunctionPropertyAssignments5_es6.js @@ -2,6 +2,7 @@ var v = { *[foo()]() { } } //// [FunctionPropertyAssignments5_es6.js] -var v = (_a = {}, _a[foo()] = function () { }, +var v = (_a = {}, + _a[foo()] = function () { }, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.js b/tests/baselines/reference/computedPropertyNames10_ES5.js index 00b43fb551d..302f9355be8 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.js +++ b/tests/baselines/reference/computedPropertyNames10_ES5.js @@ -20,6 +20,17 @@ var v = { var s; var n; var a; -var v = (_a = {}, _a[s] = function () { }, _a[n] = function () { }, _a[s + s] = function () { }, _a[s + n] = function () { }, _a[+s] = function () { }, _a[""] = function () { }, _a[0] = function () { }, _a[a] = function () { }, _a[true] = function () { }, _a["hello bye"] = function () { }, _a["hello " + a + " bye"] = function () { }, +var v = (_a = {}, + _a[s] = function () { }, + _a[n] = function () { }, + _a[s + s] = function () { }, + _a[s + n] = function () { }, + _a[+s] = function () { }, + _a[""] = function () { }, + _a[0] = function () { }, + _a[a] = function () { }, + _a[true] = function () { }, + _a["hello bye"] = function () { }, + _a["hello " + a + " bye"] = function () { }, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.js b/tests/baselines/reference/computedPropertyNames11_ES5.js index db3b12cbf32..69902003342 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.js +++ b/tests/baselines/reference/computedPropertyNames11_ES5.js @@ -20,6 +20,17 @@ var v = { var s; var n; var a; -var v = (_a = {}, _a[s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[s + s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[s + n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[+s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[""] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[0] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[a] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[true] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a["hello bye"] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a["hello " + a + " bye"] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), +var v = (_a = {}, + _a[s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), + _a[n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), + _a[s + s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), + _a[s + n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), + _a[+s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), + _a[""] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), + _a[0] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), + _a[a] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), + _a[true] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), + _a["hello bye"] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), + _a["hello " + a + " bye"] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.js b/tests/baselines/reference/computedPropertyNames18_ES5.js index 47950473370..a62af506531 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5.js +++ b/tests/baselines/reference/computedPropertyNames18_ES5.js @@ -7,8 +7,8 @@ function foo() { //// [computedPropertyNames18_ES5.js] function foo() { - var obj = (_a = {}, _a[this.bar] = - 0, + var obj = (_a = {}, + _a[this.bar] = 0, _a); var _a; } diff --git a/tests/baselines/reference/computedPropertyNames19_ES5.js b/tests/baselines/reference/computedPropertyNames19_ES5.js index fcc46aeff2f..bda3e01bbed 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5.js +++ b/tests/baselines/reference/computedPropertyNames19_ES5.js @@ -8,8 +8,8 @@ module M { //// [computedPropertyNames19_ES5.js] var M; (function (M) { - var obj = (_a = {}, _a[this.bar] = - 0, + var obj = (_a = {}, + _a[this.bar] = 0, _a); var _a; })(M || (M = {})); diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.js b/tests/baselines/reference/computedPropertyNames1_ES5.js index 115daa53ace..37e06616c2f 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5.js +++ b/tests/baselines/reference/computedPropertyNames1_ES5.js @@ -5,6 +5,8 @@ var v = { } //// [computedPropertyNames1_ES5.js] -var v = (_a = {}, _a[0 + 1] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[0 + 1] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), +var v = (_a = {}, + _a[0 + 1] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), + _a[0 + 1] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.js b/tests/baselines/reference/computedPropertyNames20_ES5.js index 06a08c6b730..1eec0a7bcdb 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5.js +++ b/tests/baselines/reference/computedPropertyNames20_ES5.js @@ -4,7 +4,7 @@ var obj = { } //// [computedPropertyNames20_ES5.js] -var obj = (_a = {}, _a[this.bar] = - 0, +var obj = (_a = {}, + _a[this.bar] = 0, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.js b/tests/baselines/reference/computedPropertyNames22_ES5.js index 12ec32d7e93..df12193250b 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5.js +++ b/tests/baselines/reference/computedPropertyNames22_ES5.js @@ -13,7 +13,8 @@ var C = (function () { function C() { } C.prototype.bar = function () { - var obj = (_a = {}, _a[this.bar()] = function () { }, + var obj = (_a = {}, + _a[this.bar()] = function () { }, _a); return 0; var _a; diff --git a/tests/baselines/reference/computedPropertyNames23_ES5.js b/tests/baselines/reference/computedPropertyNames23_ES5.js index f0eebd119e8..9e02999738c 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES5.js +++ b/tests/baselines/reference/computedPropertyNames23_ES5.js @@ -15,8 +15,8 @@ var C = (function () { C.prototype.bar = function () { return 0; }; - C.prototype[(_a = {}, _a[this.bar()] = - 1, + C.prototype[(_a = {}, + _a[this.bar()] = 1, _a)[0]] = function () { }; return C; })(); diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.js b/tests/baselines/reference/computedPropertyNames25_ES5.js index 07673dded76..f8196dd1307 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.js +++ b/tests/baselines/reference/computedPropertyNames25_ES5.js @@ -34,7 +34,8 @@ var C = (function (_super) { _super.apply(this, arguments); } C.prototype.foo = function () { - var obj = (_a = {}, _a[_super.prototype.bar.call(this)] = function () { }, + var obj = (_a = {}, + _a[_super.prototype.bar.call(this)] = function () { }, _a); return 0; var _a; diff --git a/tests/baselines/reference/computedPropertyNames26_ES5.js b/tests/baselines/reference/computedPropertyNames26_ES5.js index 50a14294c53..037bd8786e6 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.js +++ b/tests/baselines/reference/computedPropertyNames26_ES5.js @@ -34,8 +34,8 @@ var C = (function (_super) { } // Gets emitted as super, not _super, which is consistent with // use of super in static properties initializers. - C.prototype[(_a = {}, _a[super.bar.call(this)] = - 1, + C.prototype[(_a = {}, + _a[super.bar.call(this)] = 1, _a)[0]] = function () { }; return C; })(Base); diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.js b/tests/baselines/reference/computedPropertyNames28_ES5.js index 0ee4c6fcb39..b88cb0dfaf9 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -26,7 +26,8 @@ var C = (function (_super) { __extends(C, _super); function C() { _super.call(this); - var obj = (_a = {}, _a[(_super.call(this), "prop")] = function () { }, + var obj = (_a = {}, + _a[(_super.call(this), "prop")] = function () { }, _a); var _a; } diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.js b/tests/baselines/reference/computedPropertyNames29_ES5.js index 6c571ffc48d..022c930ab67 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5.js +++ b/tests/baselines/reference/computedPropertyNames29_ES5.js @@ -17,7 +17,8 @@ var C = (function () { C.prototype.bar = function () { var _this = this; (function () { - var obj = (_a = {}, _a[_this.bar()] = function () { }, + var obj = (_a = {}, + _a[_this.bar()] = function () { }, _a); var _a; }); diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index be54ac9f390..fd63a192d07 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -32,7 +32,8 @@ var C = (function (_super) { function C() { _super.call(this); (function () { - var obj = (_a = {}, _a[(_super.call(this), "prop")] = function () { }, + var obj = (_a = {}, + _a[(_super.call(this), "prop")] = function () { }, _a); var _a; }); diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.js b/tests/baselines/reference/computedPropertyNames31_ES5.js index c195af3eb5a..8a3c1a3f6c5 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.js +++ b/tests/baselines/reference/computedPropertyNames31_ES5.js @@ -38,7 +38,8 @@ var C = (function (_super) { C.prototype.foo = function () { var _this = this; (function () { - var obj = (_a = {}, _a[_super.prototype.bar.call(_this)] = function () { }, + var obj = (_a = {}, + _a[_super.prototype.bar.call(_this)] = function () { }, _a); var _a; }); diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.js b/tests/baselines/reference/computedPropertyNames33_ES5.js index 805531eb6b3..3d7c70a9256 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5.js +++ b/tests/baselines/reference/computedPropertyNames33_ES5.js @@ -15,7 +15,8 @@ var C = (function () { function C() { } C.prototype.bar = function () { - var obj = (_a = {}, _a[foo()] = function () { }, + var obj = (_a = {}, + _a[foo()] = function () { }, _a); return 0; var _a; diff --git a/tests/baselines/reference/computedPropertyNames34_ES5.js b/tests/baselines/reference/computedPropertyNames34_ES5.js index 8e5fbe96f67..fd46b144fa5 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES5.js +++ b/tests/baselines/reference/computedPropertyNames34_ES5.js @@ -15,7 +15,8 @@ var C = (function () { function C() { } C.bar = function () { - var obj = (_a = {}, _a[foo()] = function () { }, + var obj = (_a = {}, + _a[foo()] = function () { }, _a); return 0; var _a; diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.js b/tests/baselines/reference/computedPropertyNames46_ES5.js index 0cd5bd9beab..815f5769f3b 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5.js +++ b/tests/baselines/reference/computedPropertyNames46_ES5.js @@ -4,7 +4,7 @@ var o = { }; //// [computedPropertyNames46_ES5.js] -var o = (_a = {}, _a["" || 0] = - 0, +var o = (_a = {}, + _a["" || 0] = 0, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.js b/tests/baselines/reference/computedPropertyNames47_ES5.js index 2ec3fa5d668..7d839e16ffb 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5.js +++ b/tests/baselines/reference/computedPropertyNames47_ES5.js @@ -14,7 +14,7 @@ var E2; (function (E2) { E2[E2["x"] = 0] = "x"; })(E2 || (E2 = {})); -var o = (_a = {}, _a[0 /* x */ || 0 /* x */] = - 0, +var o = (_a = {}, + _a[0 /* x */ || 0 /* x */] = 0, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.js b/tests/baselines/reference/computedPropertyNames48_ES5.js index 4a397507680..c5ca0d5b241 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5.js +++ b/tests/baselines/reference/computedPropertyNames48_ES5.js @@ -23,13 +23,13 @@ var E; E[E["x"] = 0] = "x"; })(E || (E = {})); var a; -extractIndexer((_a = {}, _a[a] = - "", +extractIndexer((_a = {}, + _a[a] = "", _a)); // Should return string -extractIndexer((_b = {}, _b[0 /* x */] = - "", +extractIndexer((_b = {}, + _b[0 /* x */] = "", _b)); // Should return string -extractIndexer((_c = {}, _c["" || 0] = - "", +extractIndexer((_c = {}, + _c["" || 0] = "", _c)); // Should return any (widened form of undefined) var _a, _b, _c; diff --git a/tests/baselines/reference/computedPropertyNames49_ES5.js b/tests/baselines/reference/computedPropertyNames49_ES5.js index 79c09624f4f..5f952c6f3f1 100644 --- a/tests/baselines/reference/computedPropertyNames49_ES5.js +++ b/tests/baselines/reference/computedPropertyNames49_ES5.js @@ -28,19 +28,23 @@ var x = { //// [computedPropertyNames49_ES5.js] var x = (_a = { p1: 10 -}, _a.p1 = - 10, _a[1 + 1] = Object.defineProperty({ get: function () { - throw 10; - }, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ get: function () { - return 10; - }, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ set: function () { - // just throw - throw 10; - }, enumerable: true, configurable: true }), _a.foo = Object.defineProperty({ get: function () { - if (1 == 1) { +}, + _a.p1 = 10, + _a[1 + 1] = Object.defineProperty({ get: function () { + throw 10; + }, enumerable: true, configurable: true }), + _a[1 + 1] = Object.defineProperty({ get: function () { return 10; - } - }, enumerable: true, configurable: true }), _a.p2 = - 20, + }, enumerable: true, configurable: true }), + _a[1 + 1] = Object.defineProperty({ set: function () { + // just throw + throw 10; + }, enumerable: true, configurable: true }), + _a.foo = Object.defineProperty({ get: function () { + if (1 == 1) { + return 10; + } + }, enumerable: true, configurable: true }), + _a.p2 = 20, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.js b/tests/baselines/reference/computedPropertyNames4_ES5.js index 22e23f14905..ac0fa8ec937 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.js +++ b/tests/baselines/reference/computedPropertyNames4_ES5.js @@ -20,17 +20,17 @@ var v = { var s; var n; var a; -var v = (_a = {}, _a[s] = - 0, _a[n] = - n, _a[s + s] = - 1, _a[s + n] = - 2, _a[+s] = - s, _a[""] = - 0, _a[0] = - 0, _a[a] = - 1, _a[true] = - 0, _a["hello bye"] = - 0, _a["hello " + a + " bye"] = - 0, +var v = (_a = {}, + _a[s] = 0, + _a[n] = n, + _a[s + s] = 1, + _a[s + n] = 2, + _a[+s] = s, + _a[""] = 0, + _a[0] = 0, + _a[a] = 1, + _a[true] = 0, + _a["hello bye"] = 0, + _a["hello " + a + " bye"] = 0, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames50_ES5.js b/tests/baselines/reference/computedPropertyNames50_ES5.js index 36ca71707cc..32502d80e0a 100644 --- a/tests/baselines/reference/computedPropertyNames50_ES5.js +++ b/tests/baselines/reference/computedPropertyNames50_ES5.js @@ -33,19 +33,23 @@ var x = (_a = { return 10; } } -}, _a.p1 = - 10, _a.foo = Object.defineProperty({ get: function () { - if (1 == 1) { +}, + _a.p1 = 10, + _a.foo = Object.defineProperty({ get: function () { + if (1 == 1) { + return 10; + } + }, enumerable: true, configurable: true }), + _a[1 + 1] = Object.defineProperty({ get: function () { + throw 10; + }, enumerable: true, configurable: true }), + _a[1 + 1] = Object.defineProperty({ set: function () { + // just throw + throw 10; + }, enumerable: true, configurable: true }), + _a[1 + 1] = Object.defineProperty({ get: function () { return 10; - } - }, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ get: function () { - throw 10; - }, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ set: function () { - // just throw - throw 10; - }, enumerable: true, configurable: true }), _a[1 + 1] = Object.defineProperty({ get: function () { - return 10; - }, enumerable: true, configurable: true }), _a.p2 = - 20, + }, enumerable: true, configurable: true }), + _a.p2 = 20, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames5_ES5.js b/tests/baselines/reference/computedPropertyNames5_ES5.js index e99c4ed73b7..3367faa2c20 100644 --- a/tests/baselines/reference/computedPropertyNames5_ES5.js +++ b/tests/baselines/reference/computedPropertyNames5_ES5.js @@ -11,12 +11,12 @@ var v = { //// [computedPropertyNames5_ES5.js] var b; -var v = (_a = {}, _a[b] = - 0, _a[true] = - 1, _a[[]] = - 0, _a[{}] = - 0, _a[undefined] = - undefined, _a[null] = - null, +var v = (_a = {}, + _a[b] = 0, + _a[true] = 1, + _a[[]] = 0, + _a[{}] = 0, + _a[undefined] = undefined, + _a[null] = null, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames6_ES5.js b/tests/baselines/reference/computedPropertyNames6_ES5.js index a4b9f2131e2..29d035bfcbf 100644 --- a/tests/baselines/reference/computedPropertyNames6_ES5.js +++ b/tests/baselines/reference/computedPropertyNames6_ES5.js @@ -12,9 +12,9 @@ var v = { var p1; var p2; var p3; -var v = (_a = {}, _a[p1] = - 0, _a[p2] = - 1, _a[p3] = - 2, +var v = (_a = {}, + _a[p1] = 0, + _a[p2] = 1, + _a[p3] = 2, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.js b/tests/baselines/reference/computedPropertyNames7_ES5.js index bd19f0cc5e4..9c23dcab20d 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5.js +++ b/tests/baselines/reference/computedPropertyNames7_ES5.js @@ -11,7 +11,7 @@ var E; (function (E) { E[E["member"] = 0] = "member"; })(E || (E = {})); -var v = (_a = {}, _a[0 /* member */] = - 0, +var v = (_a = {}, + _a[0 /* member */] = 0, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNames8_ES5.js b/tests/baselines/reference/computedPropertyNames8_ES5.js index 9035777bcba..82d262c7e4e 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES5.js +++ b/tests/baselines/reference/computedPropertyNames8_ES5.js @@ -12,9 +12,9 @@ function f() { function f() { var t; var u; - var v = (_a = {}, _a[t] = - 0, _a[u] = - 1, + var v = (_a = {}, + _a[t] = 0, + _a[u] = 1, _a); var _a; } diff --git a/tests/baselines/reference/computedPropertyNames9_ES5.js b/tests/baselines/reference/computedPropertyNames9_ES5.js index 1c5198da767..b1ac6c9e3b6 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES5.js +++ b/tests/baselines/reference/computedPropertyNames9_ES5.js @@ -12,9 +12,9 @@ var v = { //// [computedPropertyNames9_ES5.js] function f(x) { } -var v = (_a = {}, _a[f("")] = - 0, _a[f(0)] = - 0, _a[f(true)] = - 0, +var v = (_a = {}, + _a[f("")] = 0, + _a[f(0)] = 0, + _a[f(true)] = 0, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js index c29260da041..d8a33951d4a 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.js @@ -9,8 +9,8 @@ var o: I = { } //// [computedPropertyNamesContextualType10_ES5.js] -var o = (_a = {}, _a[+"foo"] = - "", _a[+"bar"] = - 0, +var o = (_a = {}, + _a[+"foo"] = "", + _a[+"bar"] = 0, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js index 60d5706e3f4..1ee88351154 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.js @@ -10,7 +10,8 @@ var o: I = { } //// [computedPropertyNamesContextualType1_ES5.js] -var o = (_a = {}, _a["" + 0] = function (y) { return y.length; }, _a["" + 1] = - function (y) { return y.length; }, +var o = (_a = {}, + _a["" + 0] = function (y) { return y.length; }, + _a["" + 1] = function (y) { return y.length; }, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js index aba28acdd24..6be09e4bef3 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.js @@ -10,7 +10,8 @@ var o: I = { } //// [computedPropertyNamesContextualType2_ES5.js] -var o = (_a = {}, _a[+"foo"] = function (y) { return y.length; }, _a[+"bar"] = - function (y) { return y.length; }, +var o = (_a = {}, + _a[+"foo"] = function (y) { return y.length; }, + _a[+"bar"] = function (y) { return y.length; }, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js index 6752bf590dc..b510cda2916 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.js @@ -9,7 +9,8 @@ var o: I = { } //// [computedPropertyNamesContextualType3_ES5.js] -var o = (_a = {}, _a[+"foo"] = function (y) { return y.length; }, _a[+"bar"] = - function (y) { return y.length; }, +var o = (_a = {}, + _a[+"foo"] = function (y) { return y.length; }, + _a[+"bar"] = function (y) { return y.length; }, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js index 6e9dbab4b53..0c319a526f4 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.js @@ -10,8 +10,8 @@ var o: I = { } //// [computedPropertyNamesContextualType4_ES5.js] -var o = (_a = {}, _a["" + "foo"] = - "", _a["" + "bar"] = - 0, +var o = (_a = {}, + _a["" + "foo"] = "", + _a["" + "bar"] = 0, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js index 1d7d456195e..51d78be59d4 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.js @@ -10,8 +10,8 @@ var o: I = { } //// [computedPropertyNamesContextualType5_ES5.js] -var o = (_a = {}, _a[+"foo"] = - "", _a[+"bar"] = - 0, +var o = (_a = {}, + _a[+"foo"] = "", + _a[+"bar"] = 0, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js index 82229dc92e2..f50231e3f0f 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.js @@ -17,11 +17,11 @@ foo({ foo((_a = { p: "", 0: function () { } -}, _a.p = - "", _a[0] = - function () { }, _a["hi" + "bye"] = - true, _a[0 + 1] = - 0, _a[+"hi"] = - [0], +}, + _a.p = "", + _a[0] = function () { }, + _a["hi" + "bye"] = true, + _a[0 + 1] = 0, + _a[+"hi"] = [0], _a)); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js index ca335566d7e..e1c567c62d9 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.js @@ -17,11 +17,11 @@ foo({ foo((_a = { p: "", 0: function () { } -}, _a.p = - "", _a[0] = - function () { }, _a["hi" + "bye"] = - true, _a[0 + 1] = - 0, _a[+"hi"] = - [0], +}, + _a.p = "", + _a[0] = function () { }, + _a["hi" + "bye"] = true, + _a[0 + 1] = 0, + _a[+"hi"] = [0], _a)); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js index 89ea38eaa74..24f6218864c 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.js @@ -10,8 +10,8 @@ var o: I = { } //// [computedPropertyNamesContextualType8_ES5.js] -var o = (_a = {}, _a["" + "foo"] = - "", _a["" + "bar"] = - 0, +var o = (_a = {}, + _a["" + "foo"] = "", + _a["" + "bar"] = 0, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js index b4f94dcadbe..340802da2af 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.js @@ -10,8 +10,8 @@ var o: I = { } //// [computedPropertyNamesContextualType9_ES5.js] -var o = (_a = {}, _a[+"foo"] = - "", _a[+"bar"] = - 0, +var o = (_a = {}, + _a[+"foo"] = "", + _a[+"bar"] = 0, _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js index bb495c0f532..58c3133e6ee 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.js @@ -7,8 +7,11 @@ var v = { } //// [computedPropertyNamesDeclarationEmit5_ES5.js] -var v = (_a = {}, _a["" + ""] = - 0, _a["" + ""] = function () { }, _a["" + ""] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a["" + ""] = Object.defineProperty({ set: function (x) { }, enumerable: true, configurable: true }), +var v = (_a = {}, + _a["" + ""] = 0, + _a["" + ""] = function () { }, + _a["" + ""] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), + _a["" + ""] = Object.defineProperty({ set: function (x) { }, enumerable: true, configurable: true }), _a); var _a; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js index 299c5994424..972aaf9b52f 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js @@ -6,9 +6,10 @@ var v = { } //// [computedPropertyNamesSourceMap2_ES5.js] -var v = (_a = {}, _a["hello"] = function () { - debugger; -}, +var v = (_a = {}, + _a["hello"] = function () { + debugger; + }, _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 2ea24d441ea..c450a844d5a 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":[],"mappings":"AAAA,IAAI,CAAC,GAAG,AADA,CACA,EAAA,GADA,EAAA,EACA,EAAA,CACK,OAAO,CAFA,GAAA;IAGA,QAAQ,CAAC;AACb,CAAC,AAJA;IACA,EAAA,AADA,CAKA,CAAA;IAJD,EAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,AADA,CACA,EAAA,GADA,EAAA;IACA,EAAA,CACK,OAAO,CAFA,GAAA;QAGA,QAAQ,CAAC;IACb,CAAC,AAJA;IAAA,EAAA,CAKA,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 bc6d862eb93..8e5b2aac877 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt @@ -8,7 +8,7 @@ sources: computedPropertyNamesSourceMap2_ES5.ts emittedFile:tests/cases/conformance/es6/computedProperties/computedPropertyNamesSourceMap2_ES5.js sourceFile:computedPropertyNamesSourceMap2_ES5.ts ------------------------------------------------------------------- ->>>var v = (_a = {}, _a["hello"] = function () { +>>>var v = (_a = {}, 1 > 2 >^^^^ 3 > ^ @@ -18,12 +18,7 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 7 > ^^ 8 > ^^^ 9 > ^^ -10> ^^ -11> ^^ -12> ^ -13> ^^^^^^^ -14> ^ -15> ^^^ +10> ^^^^^^^^^^^^^^^^-> 1 > 2 >var 3 > v @@ -43,25 +38,6 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 9 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found 9 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 15) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 17) Source(0, NaN) + SourceIndex(0) nameIndex (-1) 9 > -10> !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -10> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 15) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 19) Source(1, 1) + SourceIndex(0) nameIndex (-1) -10> -11> !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -11> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 17) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 21) Source(1, 1) + SourceIndex(0) nameIndex (-1) -11> -12> !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -12> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 17) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 22) Source(2, 6) + SourceIndex(0) nameIndex (-1) -12> var v = { - > [ -13> !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -13> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 19) Source(1, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 29) Source(2, 13) + SourceIndex(0) nameIndex (-1) -13> "hello" -14> !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -14> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 21) Source(1, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 30) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -14> -15> !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -15> !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 22) Source(2, 14) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(1, 33) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -15> 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) 3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) @@ -71,89 +47,111 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts 7 >Emitted(1, 12) Source(1, 1) + SourceIndex(0) 8 >Emitted(1, 15) Source(0, NaN) + SourceIndex(0) 9 >Emitted(1, 17) Source(0, NaN) + SourceIndex(0) -10>Emitted(1, 19) Source(1, 1) + SourceIndex(0) -11>Emitted(1, 21) Source(1, 1) + SourceIndex(0) -12>Emitted(1, 22) Source(2, 6) + SourceIndex(0) -13>Emitted(1, 29) Source(2, 13) + SourceIndex(0) -14>Emitted(1, 30) Source(0, NaN) + SourceIndex(0) -15>Emitted(1, 33) Source(0, NaN) + SourceIndex(0) --- ->>> debugger; -1 >^^^^ -2 > ^^^^^^^^ -3 > ^ -1 >!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 29) Source(2, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 5) Source(3, 9) + SourceIndex(0) nameIndex (-1) -1 > +>>> _a["hello"] = function () { +1->^^^^ +2 > ^^ +3 > ^ +4 > ^^^^^^^ +5 > ^ +6 > ^^^ +1->!!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column +1->!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 15) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 5) Source(1, 1) + SourceIndex(0) nameIndex (-1) +1-> 2 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 30) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 13) Source(3, 17) + SourceIndex(0) nameIndex (-1) -2 > debugger -3 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 30) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 14) Source(3, 18) + SourceIndex(0) nameIndex (-1) -3 > ; -1 >Emitted(2, 5) Source(3, 9) + SourceIndex(0) -2 >Emitted(2, 13) Source(3, 17) + SourceIndex(0) -3 >Emitted(2, 14) Source(3, 18) + SourceIndex(0) +2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 17) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 7) Source(1, 1) + SourceIndex(0) nameIndex (-1) +2 > +3 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column +3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 17) Source(0, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 8) Source(2, 6) + SourceIndex(0) nameIndex (-1) +3 > var v = { + > [ +4 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: +4 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 5) Source(1, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 15) Source(2, 13) + SourceIndex(0) nameIndex (-1) +4 > "hello" +5 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: +5 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 7) Source(1, 9) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 16) Source(0, NaN) + SourceIndex(0) nameIndex (-1) +5 > +6 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: +6 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 8) Source(2, 14) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(2, 19) Source(0, NaN) + SourceIndex(0) nameIndex (-1) +6 > +1->Emitted(2, 5) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 7) Source(1, 1) + SourceIndex(0) +3 >Emitted(2, 8) Source(2, 6) + SourceIndex(0) +4 >Emitted(2, 15) Source(2, 13) + SourceIndex(0) +5 >Emitted(2, 16) Source(0, NaN) + SourceIndex(0) +6 >Emitted(2, 19) Source(0, NaN) + SourceIndex(0) --- ->>>}, +>>> debugger; +1 >^^^^^^^^ +2 > ^^^^^^^^ +3 > ^ +1 >!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: +1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 15) Source(2, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 9) Source(3, 9) + SourceIndex(0) nameIndex (-1) 1 > -2 >^ -3 > -4 > ^^^^^^^^-> +2 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found +2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 16) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 17) Source(3, 17) + SourceIndex(0) nameIndex (-1) +2 > debugger +3 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column +3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 16) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 18) Source(3, 18) + SourceIndex(0) nameIndex (-1) +3 > ; +1 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) +2 >Emitted(3, 17) Source(3, 17) + SourceIndex(0) +3 >Emitted(3, 18) Source(3, 18) + SourceIndex(0) +--- +>>> }, +1 >^^^^ +2 > ^ +3 > +4 > ^^^^-> 1 >!!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 33) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 1) Source(4, 5) + SourceIndex(0) nameIndex (-1) +1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 19) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 5) Source(4, 5) + SourceIndex(0) nameIndex (-1) 1 > > -2 >!!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -2 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(1, 33) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 2) Source(4, 6) + SourceIndex(0) nameIndex (-1) -2 >} -3 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 5) Source(3, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(3, 2) Source(0, NaN) + SourceIndex(0) nameIndex (-1) -3 > -1 >Emitted(3, 1) Source(4, 5) + SourceIndex(0) -2 >Emitted(3, 2) Source(4, 6) + SourceIndex(0) -3 >Emitted(3, 2) Source(0, NaN) + SourceIndex(0) +2 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column +2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 19) Source(0, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 6) Source(4, 6) + SourceIndex(0) nameIndex (-1) +2 > } +3 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: +3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 9) Source(3, 21) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 6) Source(0, NaN) + SourceIndex(0) nameIndex (-1) +3 > +1 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) +3 >Emitted(4, 6) Source(0, NaN) + SourceIndex(0) --- >>> _a); 1->^^^^ 2 > ^^ -3 > -4 > ^ -5 > ^ +3 > ^ +4 > ^ 1->!!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -1->!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 13) Source(3, 29) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 5) Source(1, 1) + SourceIndex(0) nameIndex (-1) +1->!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 17) Source(3, 29) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 5) Source(0, NaN) + SourceIndex(0) nameIndex (-1) 1-> 2 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(2, 14) Source(3, 30) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 7) Source(1, 1) + SourceIndex(0) nameIndex (-1) +2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 18) Source(3, 30) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 7) Source(0, NaN) + SourceIndex(0) nameIndex (-1) 2 > 3 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 1) Source(4, 17) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 7) Source(0, NaN) + SourceIndex(0) nameIndex (-1) +3 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 5) Source(4, 17) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 8) Source(5, 2) + SourceIndex(0) nameIndex (-1) 3 > -4 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -4 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(4, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 8) Source(5, 2) + SourceIndex(0) nameIndex (-1) -4 > -5 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found -5 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(4, 9) Source(5, 2) + SourceIndex(0) nameIndex (-1) -5 > -1->Emitted(4, 5) Source(1, 1) + SourceIndex(0) -2 >Emitted(4, 7) Source(1, 1) + SourceIndex(0) -3 >Emitted(4, 7) Source(0, NaN) + SourceIndex(0) -4 >Emitted(4, 8) Source(5, 2) + SourceIndex(0) -5 >Emitted(4, 9) Source(5, 2) + SourceIndex(0) +4 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: +4 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 6) Source(4, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 9) Source(5, 2) + SourceIndex(0) nameIndex (-1) +4 > +1->Emitted(5, 5) Source(0, NaN) + SourceIndex(0) +2 >Emitted(5, 7) Source(0, NaN) + SourceIndex(0) +3 >Emitted(5, 8) Source(5, 2) + SourceIndex(0) +4 >Emitted(5, 9) Source(5, 2) + SourceIndex(0) --- >>>var _a; 1 >^^^^ 2 > ^^ 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 >!!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column -1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(3, 2) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 5) Source(1, 1) + SourceIndex(0) nameIndex (-1) +1 >!!^^ !!^^ There was decoding error in the sourcemap at this location: Invalid sourceLine found +1 >!!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 6) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(6, 5) Source(1, 1) + SourceIndex(0) nameIndex (-1) 1 > -2 > !!^^ !!^^ The decoded span from sourcemap's mapping entry does not match what was encoded for this span: -2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 5) Source(1, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(5, 7) Source(1, 1) + SourceIndex(0) nameIndex (-1) +2 > !!^^ !!^^ There was decoding error in the sourcemap at this location: Unsupported Error Format: No entries after emitted column +2 > !!^^ !!^^ Decoded span from sourcemap's mappings entry: Emitted(4, 6) Source(0, 18) + SourceIndex(0) nameIndex (-1) Span encoded by the emitter:Emitted(6, 7) Source(1, 1) + SourceIndex(0) nameIndex (-1) 2 > -1 >Emitted(5, 5) Source(1, 1) + SourceIndex(0) -2 >Emitted(5, 7) Source(1, 1) + SourceIndex(0) +1 >Emitted(6, 5) Source(1, 1) + SourceIndex(0) +2 >Emitted(6, 7) Source(1, 1) + SourceIndex(0) --- !!!! **** There are more source map entries in the sourceMap's mapping than what was encoded -!!!! **** Remaining decoded string: ,EAAA,AADA,CAKA,CAAA;IAJD,EAAA +!!!! **** Remaining decoded string: ;IAAA,EAAA,CAKA,CAAA;IAJD,EAAA >>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map \ No newline at end of file diff --git a/tests/baselines/reference/parserES5ComputedPropertyName2.js b/tests/baselines/reference/parserES5ComputedPropertyName2.js index cd5b088d0ec..d8a5bb45fac 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName2.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName2.js @@ -2,7 +2,7 @@ var v = { [e]: 1 }; //// [parserES5ComputedPropertyName2.js] -var v = (_a = {}, _a[e] = - 1, +var v = (_a = {}, + _a[e] = 1, _a); var _a; diff --git a/tests/baselines/reference/parserES5ComputedPropertyName3.js b/tests/baselines/reference/parserES5ComputedPropertyName3.js index 8bfed4e8228..26067467953 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName3.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName3.js @@ -2,6 +2,7 @@ var v = { [e]() { } }; //// [parserES5ComputedPropertyName3.js] -var v = (_a = {}, _a[e] = function () { }, +var v = (_a = {}, + _a[e] = function () { }, _a); var _a; diff --git a/tests/baselines/reference/parserES5ComputedPropertyName4.js b/tests/baselines/reference/parserES5ComputedPropertyName4.js index bb0b389afdf..378624af08b 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName4.js +++ b/tests/baselines/reference/parserES5ComputedPropertyName4.js @@ -2,6 +2,7 @@ var v = { get [e]() { } }; //// [parserES5ComputedPropertyName4.js] -var v = (_a = {}, _a[e] = Object.defineProperty({ get: function () { }, enumerable: true, configurable: true }), +var v = (_a = {}, + _a[e] = Object.defineProperty({ get: function () { }, enumerable: true, configurable: true }), _a); var _a; diff --git a/tests/baselines/reference/privateIndexer2.js b/tests/baselines/reference/privateIndexer2.js index 40b28ce9809..a90e03a5bc2 100644 --- a/tests/baselines/reference/privateIndexer2.js +++ b/tests/baselines/reference/privateIndexer2.js @@ -11,9 +11,9 @@ var y: { //// [privateIndexer2.js] // private indexers not allowed -var x = (_a = {}, _a[x] = - string, _a.string = -, +var x = (_a = {}, + _a[x] = string, + _a.string = , _a); var y; var _a;