From 345622d22d3466bba17a6a33454e6bde63ef6431 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 18 Aug 2017 23:53:20 +0100 Subject: [PATCH 1/9] Add test that demonstrates bug --- .../reference/propertyAccessOnEmptyObjectLiteral.js | 12 ++++++++++++ .../propertyAccessOnEmptyObjectLiteral.symbols | 9 +++++++++ .../propertyAccessOnEmptyObjectLiteral.types | 13 +++++++++++++ .../compiler/propertyAccessOnEmptyObjectLiteral.ts | 3 +++ 4 files changed, 37 insertions(+) create mode 100644 tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.js create mode 100644 tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.symbols create mode 100644 tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.types create mode 100644 tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts diff --git a/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.js b/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.js new file mode 100644 index 00000000000..f485e4fa618 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.js @@ -0,0 +1,12 @@ +//// [propertyAccessOnEmptyObjectLiteral.ts] +class A { } + +({}).toString(); + +//// [propertyAccessOnEmptyObjectLiteral.js] +var A = /** @class */ (function () { + function A() { + } + return A; +}()); +({}).toString(); diff --git a/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.symbols b/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.symbols new file mode 100644 index 00000000000..721cce14900 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts === +class A { } +>A : Symbol(A, Decl(propertyAccessOnEmptyObjectLiteral.ts, 0, 0)) + +({}).toString(); +>({}).toString : Symbol(Object.toString, Decl(lib.d.ts, --, --)) +>A : Symbol(A, Decl(propertyAccessOnEmptyObjectLiteral.ts, 0, 0)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.types b/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.types new file mode 100644 index 00000000000..ac92f934066 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts === +class A { } +>A : A + +({}).toString(); +>({}).toString() : string +>({}).toString : () => string +>({}) : A +>{} : A +>A : A +>{} : {} +>toString : () => string + diff --git a/tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts b/tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts new file mode 100644 index 00000000000..6112f269ee8 --- /dev/null +++ b/tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts @@ -0,0 +1,3 @@ +class A { } + +({}).toString(); \ No newline at end of file From 424e84c112d02ac4e193267630f05748c9fae0d0 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Sat, 19 Aug 2017 00:01:14 +0100 Subject: [PATCH 2/9] Fix empty object literal property access --- src/compiler/factory.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index daec1bce1e8..576f59e590f 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -3811,14 +3811,18 @@ namespace ts { */ export function parenthesizeForAccess(expression: Expression): LeftHandSideExpression { // isLeftHandSideExpression is almost the correct criterion for when it is not necessary - // to parenthesize the expression before a dot. The known exception is: + // to parenthesize the expression before a dot. There are two known exceptions: // // NewExpression: // new C.x -> not the same as (new C).x // + // EmptyObjectLiteral: + // {}.toString() -> is incorrect syntax, should be ({}).x + // const emittedExpression = skipPartiallyEmittedExpressions(expression); if (isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== SyntaxKind.NewExpression || (emittedExpression).arguments)) { + && (emittedExpression.kind !== SyntaxKind.NewExpression || (emittedExpression).arguments) + && !isEmptyObjectLiteral(emittedExpression)) { return expression; } From eff6a3a7b637b3dc43826b0800920d5dc2a18859 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Sat, 19 Aug 2017 01:00:56 +0100 Subject: [PATCH 3/9] Clean up other statement to match style --- src/compiler/factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 576f59e590f..7a20a6d8a41 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -3821,7 +3821,7 @@ namespace ts { // const emittedExpression = skipPartiallyEmittedExpressions(expression); if (isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== SyntaxKind.NewExpression || (emittedExpression).arguments) + && (!isNewExpression(emittedExpression) || (emittedExpression).arguments) && !isEmptyObjectLiteral(emittedExpression)) { return expression; } From 70c4aa8fdc0db5d67310b985c0ebae1be5028a23 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Sat, 19 Aug 2017 01:33:28 +0100 Subject: [PATCH 4/9] Fix tests that had syntax errors with empty object literal property accesses --- .../baselines/reference/blockScopedBindingUsedBeforeDef.js | 4 ++-- .../reference/computedPropertiesInDestructuring2.js | 2 +- .../reference/controlFlowDestructuringDeclaration.js | 6 +++--- .../destructuringObjectBindingPatternAndAssignment1ES5.js | 2 +- .../shorthandPropertyAssignmentsInDestructuring.js | 4 ++-- tests/baselines/reference/templateStringInPropertyName1.js | 2 +- tests/baselines/reference/templateStringInPropertyName2.js | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js b/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js index cc9ad56be88..78fd3dfc92a 100644 --- a/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js +++ b/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js @@ -15,7 +15,7 @@ for (var _i = 0, _a = [{}]; _i < _a.length; _i++) { continue; } // 2: -for (var _c = a, a = {}[_c]; false;) +for (var _c = a, a = ({})[_c]; false;) continue; // 3: -var _d = b, b = {}[_d]; +var _d = b, b = ({})[_d]; diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2.js b/tests/baselines/reference/computedPropertiesInDestructuring2.js index 8579881b775..872cf7831c7 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring2.js +++ b/tests/baselines/reference/computedPropertiesInDestructuring2.js @@ -4,4 +4,4 @@ let {[foo2()]: bar3} = {}; //// [computedPropertiesInDestructuring2.js] var foo2 = function () { return "bar"; }; -var _a = foo2(), bar3 = {}[_a]; +var _a = foo2(), bar3 = ({})[_a]; diff --git a/tests/baselines/reference/controlFlowDestructuringDeclaration.js b/tests/baselines/reference/controlFlowDestructuringDeclaration.js index 39192f1baad..2e007f2cad8 100644 --- a/tests/baselines/reference/controlFlowDestructuringDeclaration.js +++ b/tests/baselines/reference/controlFlowDestructuringDeclaration.js @@ -98,11 +98,11 @@ function f5() { z; } function f6() { - var x = {}.x; + var x = ({}).x; x; - var y = {}.y; + var y = ({}).y; y; - var _a = {}.z, z = _a === void 0 ? "" : _a; + var _a = ({}).z, z = _a === void 0 ? "" : _a; z; } function f7() { diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js index f201b17deda..21889807f6f 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js @@ -60,7 +60,7 @@ var {"prop2": d1} = foo1(); // V is an object assignment pattern and, for each assignment property P in V, // S is the type Any, or var a1 = undefined.a1; -var a2 = {}.a2; +var a2 = ({}).a2; // V is an object assignment pattern and, for each assignment property P in V, // S has an apparent property with the property name specified in // P of a type that is assignable to the target given in P, or diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js index ca874652de8..a92f3b6a63d 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js @@ -194,12 +194,12 @@ function foo({a = 4, b = { x: 5 }}) { }); (function () { var y1; - (_a = {}.y1, y1 = _a === void 0 ? 5 : _a); + (_a = ({}).y1, y1 = _a === void 0 ? 5 : _a); var _a; }); (function () { var y1; - (_a = {}.y1, y1 = _a === void 0 ? 5 : _a); + (_a = ({}).y1, y1 = _a === void 0 ? 5 : _a); var _a; }); (function () { diff --git a/tests/baselines/reference/templateStringInPropertyName1.js b/tests/baselines/reference/templateStringInPropertyName1.js index 239ba78d827..18e35c475e3 100644 --- a/tests/baselines/reference/templateStringInPropertyName1.js +++ b/tests/baselines/reference/templateStringInPropertyName1.js @@ -4,6 +4,6 @@ var x = { } //// [templateStringInPropertyName1.js] -var x = (_a = ["a"], _a.raw = ["a"], {}(_a)); +var x = (_a = ["a"], _a.raw = ["a"], ({})(_a)); 321; var _a; diff --git a/tests/baselines/reference/templateStringInPropertyName2.js b/tests/baselines/reference/templateStringInPropertyName2.js index 8a71a6e30be..1a2995ca08f 100644 --- a/tests/baselines/reference/templateStringInPropertyName2.js +++ b/tests/baselines/reference/templateStringInPropertyName2.js @@ -4,6 +4,6 @@ var x = { } //// [templateStringInPropertyName2.js] -var x = (_a = ["abc", "def", "ghi"], _a.raw = ["abc", "def", "ghi"], {}(_a, 123, 456)); +var x = (_a = ["abc", "def", "ghi"], _a.raw = ["abc", "def", "ghi"], ({})(_a, 123, 456)); 321; var _a; From 2c028ae3e521a940e6abd8a663b3e9101e44f145 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 28 Aug 2017 23:14:19 +0100 Subject: [PATCH 5/9] Generalise empty object literal property access fix to all object literals --- src/compiler/factory.ts | 6 +- .../reference/assignmentTypeNarrowing.js | 8 +- .../reference/asyncMethodWithSuper_es5.js | 4 +- .../computedPropertiesInDestructuring1.js | 12 +- .../contextuallyTypedBindingInitializer.js | 2 +- ...extuallyTypedBindingInitializerNegative.js | 2 +- .../controlFlowDestructuringDeclaration.js | 12 +- ...onEmitDestructuringObjectLiteralPattern.js | 8 +- ...nEmitDestructuringObjectLiteralPattern1.js | 8 +- .../reference/declarationsAndAssignments.js | 8 +- ...ngObjectBindingPatternAndAssignment1ES5.js | 10 +- ...uringObjectBindingPatternAndAssignment3.js | 10 +- .../destructuringVariableDeclaration1ES5.js | 10 +- ...ucturingVariableDeclaration1ES5iterable.js | 10 +- .../destructuringVariableDeclaration2.js | 2 +- .../reference/downlevelLetConst12.js | 4 +- .../reference/downlevelLetConst13.js | 8 +- .../reference/downlevelLetConst14.js | 8 +- .../reference/downlevelLetConst15.js | 8 +- .../reference/downlevelLetConst16.js | 28 +- ...jectLiteralExpressionInArrowFunctionES5.js | 4 +- ...jectLiteralExpressionInArrowFunctionES6.js | 4 +- .../emitArrowFunctionWhenUsingArguments17.js | 2 +- .../emitArrowFunctionWhenUsingArguments18.js | 2 +- .../initializePropertiesWithRenamedLet.js | 8 +- .../baselines/reference/letInNonStrictMode.js | 2 +- .../literalTypesAndTypeAssertions.js | 8 +- .../reference/missingAndExcessProperties.js | 8 +- ...oImplicitAnyDestructuringVarDeclaration.js | 2 +- ...ImplicitAnyDestructuringVarDeclaration2.js | 2 +- ...bjectBindingPatternKeywordIdentifiers01.js | 2 +- ...bjectBindingPatternKeywordIdentifiers03.js | 2 +- ...bjectBindingPatternKeywordIdentifiers05.js | 2 +- ...bjectBindingPatternKeywordIdentifiers06.js | 2 +- .../shadowingViaLocalValueOrBindingElement.js | 8 +- ...thandPropertyAssignmentsInDestructuring.js | 12 +- ...ionDestructuringForObjectBindingPattern.js | 4 +- ...estructuringForObjectBindingPattern.js.map | 2 +- ...uringForObjectBindingPattern.sourcemap.txt | 200 +++++++------- ...ingForObjectBindingPatternDefaultValues.js | 4 +- ...orObjectBindingPatternDefaultValues.js.map | 2 +- ...tBindingPatternDefaultValues.sourcemap.txt | 258 +++++++++--------- ...gVariableStatementObjectBindingPattern1.js | 2 +- ...iableStatementObjectBindingPattern1.js.map | 2 +- ...atementObjectBindingPattern1.sourcemap.txt | 14 +- ...gVariableStatementObjectBindingPattern2.js | 2 +- ...iableStatementObjectBindingPattern2.js.map | 2 +- ...atementObjectBindingPattern2.sourcemap.txt | 14 +- ...gVariableStatementObjectBindingPattern3.js | 2 +- ...iableStatementObjectBindingPattern3.js.map | 2 +- ...atementObjectBindingPattern3.sourcemap.txt | 26 +- .../strictModeReservedWordInDestructuring.js | 2 +- .../strictModeUseContextualKeyword.js | 2 +- .../templateStringInObjectLiteral.js | 4 +- 54 files changed, 391 insertions(+), 391 deletions(-) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 7a20a6d8a41..0c863b38ca3 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -3816,13 +3816,13 @@ namespace ts { // NewExpression: // new C.x -> not the same as (new C).x // - // EmptyObjectLiteral: - // {}.toString() -> is incorrect syntax, should be ({}).x + // ObjectLiteral: + // {a:1}.toString() -> is incorrect syntax, should be ({a:3}).toString() // const emittedExpression = skipPartiallyEmittedExpressions(expression); if (isLeftHandSideExpression(emittedExpression) && (!isNewExpression(emittedExpression) || (emittedExpression).arguments) - && !isEmptyObjectLiteral(emittedExpression)) { + && !isObjectLiteralExpression(emittedExpression)) { return expression; } diff --git a/tests/baselines/reference/assignmentTypeNarrowing.js b/tests/baselines/reference/assignmentTypeNarrowing.js index 92fd49d9941..7c85e7dccf6 100644 --- a/tests/baselines/reference/assignmentTypeNarrowing.js +++ b/tests/baselines/reference/assignmentTypeNarrowing.js @@ -37,13 +37,13 @@ x = [true][0]; x; // boolean _a = [1][0], x = _a === void 0 ? "" : _a; x; // string | number -(x = { x: true }.x); +(x = ({ x: true }).x); x; // boolean -(x = { y: 1 }.y); +(x = ({ y: 1 }).y); x; // number -(_b = { x: true }.x, x = _b === void 0 ? "" : _b); +(_b = ({ x: true }).x, x = _b === void 0 ? "" : _b); x; // string | boolean -(_c = { y: 1 }.y, x = _c === void 0 ? /a/ : _c); +(_c = ({ y: 1 }).y, x = _c === void 0 ? /a/ : _c); x; // number | RegExp var a; for (var _i = 0, a_1 = a; _i < a_1.length; _i++) { diff --git a/tests/baselines/reference/asyncMethodWithSuper_es5.js b/tests/baselines/reference/asyncMethodWithSuper_es5.js index a2931b9f8e1..0dbeedabe52 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es5.js +++ b/tests/baselines/reference/asyncMethodWithSuper_es5.js @@ -95,9 +95,9 @@ var B = /** @class */ (function (_super) { // element access (assign) _super.prototype["x"] = f; // destructuring assign with property access - (_super.prototype.x = { f: f }.f); + (_super.prototype.x = ({ f: f }).f); // destructuring assign with element access - (_super.prototype["x"] = { f: f }.f); + (_super.prototype["x"] = ({ f: f }).f); return [2 /*return*/]; }); }); diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1.js b/tests/baselines/reference/computedPropertiesInDestructuring1.js index e4f15e6b8bf..39d411fb851 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1.js +++ b/tests/baselines/reference/computedPropertiesInDestructuring1.js @@ -40,10 +40,10 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; //// [computedPropertiesInDestructuring1.js] // destructuring in variable declarations var foo = "bar"; -var _a = foo, bar = { bar: "bar" }[_a]; -var bar2 = { bar: "bar" }["bar"]; +var _a = foo, bar = ({ bar: "bar" })[_a]; +var bar2 = ({ bar: "bar" })["bar"]; var foo2 = function () { return "bar"; }; -var _b = foo2(), bar3 = { bar: "bar" }[_b]; +var _b = foo2(), bar3 = ({ bar: "bar" })[_b]; var _c = foo, bar4 = [{ bar: "bar" }][0][_c]; var _d = foo2(), bar5 = [{ bar: "bar" }][0][_d]; function f1(_a) { @@ -65,9 +65,9 @@ function f5(_a) { var _e = foo(), bar6 = [{ bar: "bar" }][0][_e]; var _f = foo.toExponential(), bar7 = [{ bar: "bar" }][0][_f]; // destructuring assignment -(_g = foo, bar = { bar: "bar" }[_g]); -(bar2 = { bar: "bar" }["bar"]); -(_h = foo2(), bar3 = { bar: "bar" }[_h]); +(_g = foo, bar = ({ bar: "bar" })[_g]); +(bar2 = ({ bar: "bar" })["bar"]); +(_h = foo2(), bar3 = ({ bar: "bar" })[_h]); _j = foo, bar4 = [{ bar: "bar" }][0][_j]; _k = foo2(), bar5 = [{ bar: "bar" }][0][_k]; _l = foo(), bar4 = [{ bar: "bar" }][0][_l]; diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializer.js b/tests/baselines/reference/contextuallyTypedBindingInitializer.js index 6542e747edc..3b4956cb336 100644 --- a/tests/baselines/reference/contextuallyTypedBindingInitializer.js +++ b/tests/baselines/reference/contextuallyTypedBindingInitializer.js @@ -48,4 +48,4 @@ function g(_a) { function h(_a) { var _b = _a.prop, prop = _b === void 0 ? "foo" : _b; } -var _a = { stringIdentity: function (x) { return x; } }.stringIdentity, id = _a === void 0 ? function (arg) { return arg; } : _a; +var _a = ({ stringIdentity: function (x) { return x; } }).stringIdentity, id = _a === void 0 ? function (arg) { return arg; } : _a; diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js index bdc7ed68b3f..a2d7ba8b1aa 100644 --- a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js +++ b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js @@ -40,7 +40,7 @@ function f3(_a) { function ff(_a) { var _b = _a.nested, nestedRename = _b === void 0 ? { show: function (v) { return v; } } : _b; } -var _a = { stringIdentity: function (x) { return x; } }.stringIdentity, id = _a === void 0 ? function (arg) { return arg.length; } : _a; +var _a = ({ stringIdentity: function (x) { return x; } }).stringIdentity, id = _a === void 0 ? function (arg) { return arg.length; } : _a; function g(_a) { var _b = _a.prop, prop = _b === void 0 ? [101, 1234] : _b; } diff --git a/tests/baselines/reference/controlFlowDestructuringDeclaration.js b/tests/baselines/reference/controlFlowDestructuringDeclaration.js index 2e007f2cad8..a26899849be 100644 --- a/tests/baselines/reference/controlFlowDestructuringDeclaration.js +++ b/tests/baselines/reference/controlFlowDestructuringDeclaration.js @@ -82,19 +82,19 @@ function f3() { z; } function f4() { - var x = { x: 1 }.x; + var x = ({ x: 1 }).x; x; - var y = { y: "" }.y; + var y = ({ y: "" }).y; y; - var _a = { z: undefined }.z, z = _a === void 0 ? "" : _a; + var _a = ({ z: undefined }).z, z = _a === void 0 ? "" : _a; z; } function f5() { - var x = { x: 1 }.x; + var x = ({ x: 1 }).x; x; - var y = { y: "" }.y; + var y = ({ y: "" }).y; y; - var _a = { z: undefined }.z, z = _a === void 0 ? "" : _a; + var _a = ({ z: undefined }).z, z = _a === void 0 ? "" : _a; z; } function f6() { diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js index 0414017b776..ef82e607758 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js @@ -23,11 +23,11 @@ module m { //// [declarationEmitDestructuringObjectLiteralPattern.js] var _a = { x: 5, y: "hello" }; -var x4 = { x4: 5, y4: "hello" }.x4; -var y5 = { x5: 5, y5: "hello" }.y5; +var x4 = ({ x4: 5, y4: "hello" }).x4; +var y5 = ({ x5: 5, y5: "hello" }).y5; var _b = { x6: 5, y6: "hello" }, x6 = _b.x6, y6 = _b.y6; -var a1 = { x7: 5, y7: "hello" }.x7; -var b1 = { x8: 5, y8: "hello" }.y8; +var a1 = ({ x7: 5, y7: "hello" }).x7; +var b1 = ({ x8: 5, y8: "hello" }).y8; var _c = { x9: 5, y9: "hello" }, a2 = _c.x9, b2 = _c.y9; var _d = { a: 1, b: { a: "hello", b: { a: true } } }, x11 = _d.a, _e = _d.b, y11 = _e.a, z11 = _e.b.a; function f15() { diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js index 1e8279597d5..974dc8cc24d 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js @@ -9,11 +9,11 @@ var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; //// [declarationEmitDestructuringObjectLiteralPattern1.js] var _a = { x: 5, y: "hello" }; -var x4 = { x4: 5, y4: "hello" }.x4; -var y5 = { x5: 5, y5: "hello" }.y5; +var x4 = ({ x4: 5, y4: "hello" }).x4; +var y5 = ({ x5: 5, y5: "hello" }).y5; var _b = { x6: 5, y6: "hello" }, x6 = _b.x6, y6 = _b.y6; -var a1 = { x7: 5, y7: "hello" }.x7; -var b1 = { x8: 5, y8: "hello" }.y8; +var a1 = ({ x7: 5, y7: "hello" }).x7; +var b1 = ({ x8: 5, y8: "hello" }).y8; var _c = { x9: 5, y9: "hello" }, a2 = _c.x9, b2 = _c.y9; diff --git a/tests/baselines/reference/declarationsAndAssignments.js b/tests/baselines/reference/declarationsAndAssignments.js index 3a2f9ef3b4e..d338b454b8b 100644 --- a/tests/baselines/reference/declarationsAndAssignments.js +++ b/tests/baselines/reference/declarationsAndAssignments.js @@ -201,13 +201,13 @@ function f1() { } function f2() { var _a = { x: 5, y: "hello" }; // Error, no x and y in target - var x = { x: 5, y: "hello" }.x; // Error, no y in target - var y = { x: 5, y: "hello" }.y; // Error, no x in target + var x = ({ x: 5, y: "hello" }).x; // Error, no y in target + var y = ({ x: 5, y: "hello" }).y; // Error, no x in target var _b = { x: 5, y: "hello" }, x = _b.x, y = _b.y; var x; var y; - var a = { x: 5, y: "hello" }.x; // Error, no y in target - var b = { x: 5, y: "hello" }.y; // Error, no x in target + var a = ({ x: 5, y: "hello" }).x; // Error, no y in target + var b = ({ x: 5, y: "hello" }).y; // Error, no x in target var _c = { x: 5, y: "hello" }, a = _c.x, b = _c.y; var a; var b; diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js index 21889807f6f..dee603bd47f 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js @@ -64,11 +64,11 @@ var a2 = ({}).a2; // V is an object assignment pattern and, for each assignment property P in V, // S has an apparent property with the property name specified in // P of a type that is assignable to the target given in P, or -var b1 = { b1: 1 }.b1; -var _a = { b2: { b21: "world" } }.b2, b21 = (_a === void 0 ? { b21: "string" } : _a).b21; -var b3 = { 1: "string" }[1]; -var _b = { b4: 100000 }.b4, b4 = _b === void 0 ? 1 : _b; -var b52 = { b5: { b52: b52 } }.b5.b52; +var b1 = ({ b1: 1 }).b1; +var _a = ({ b2: { b21: "world" } }).b2, b21 = (_a === void 0 ? { b21: "string" } : _a).b21; +var b3 = ({ 1: "string" })[1]; +var _b = ({ b4: 100000 }).b4, b4 = _b === void 0 ? 1 : _b; +var b52 = ({ b5: { b52: b52 } }).b5.b52; function foo() { return { 1: true diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.js b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.js index 0872a71c73b..bec23431d98 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.js +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.js @@ -10,9 +10,9 @@ var {"prop"} = { "prop": 1 }; //// [destructuringObjectBindingPatternAndAssignment3.js] // Error -var h = { h: 1 }.h; -var i = { i: 2 }.i; -var i1 = { i1: 2 }.i1; +var h = ({ h: 1 }).h; +var i = ({ i: 2 }).i; +var i1 = ({ i1: 2 }).i1; var _a = undefined.f2, f21 = (_a === void 0 ? { f212: "string" } : _a).f21; -var = { 1: }[1]; -var = { "prop": 1 }["prop"]; +var = ({ 1: })[1]; +var = ({ "prop": 1 })["prop"]; diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.js b/tests/baselines/reference/destructuringVariableDeclaration1ES5.js index 6d731538d18..d627a87a986 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5.js +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.js @@ -48,7 +48,7 @@ var _a = { a1: 10, a2: "world" }, a1 = _a.a1, a2 = _a.a2; var _b = [1, [["hello"]], true], a3 = _b[0], a4 = _b[1][0][0], a5 = _b[2]; // The type T associated with a destructuring variable declaration is determined as follows: // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. -var _c = { b1: { b11: "world" } }.b1, b11 = (_c === void 0 ? { b11: "string" } : _c).b11; +var _c = ({ b1: { b11: "world" } }).b1, b11 = (_c === void 0 ? { b11: "string" } : _c).b11; var temp = { t1: true, t2: "false" }; var _d = [3, false, { t1: false, t2: "hello" }], _e = _d[0], b2 = _e === void 0 ? 3 : _e, _f = _d[1], b3 = _f === void 0 ? true : _f, _g = _d[2], b4 = _g === void 0 ? temp : _g; var _h = [undefined, undefined, undefined], _j = _h[0], b5 = _j === void 0 ? 3 : _j, _k = _h[1], b6 = _k === void 0 ? true : _k, _l = _h[2], b7 = _l === void 0 ? temp : _l; @@ -68,10 +68,10 @@ var _m = [1, "string"], d1 = _m[0], d2 = _m[1]; var temp1 = [true, false, true]; var _o = [1, "string"].concat(temp1), d3 = _o[0], d4 = _o[1]; // Combining both forms of destructuring, -var _p = { e: [1, 2, { b1: 4, b4: 0 }] }.e, e1 = _p[0], e2 = _p[1], _q = _p[2], e3 = _q === void 0 ? { b1: 1000, b4: 200 } : _q; -var _r = { f: [1, 2, { f3: 4, f5: 0 }] }.f, f1 = _r[0], f2 = _r[1], _s = _r[2], f4 = _s.f3, f5 = _s.f5; +var _p = ({ e: [1, 2, { b1: 4, b4: 0 }] }).e, e1 = _p[0], e2 = _p[1], _q = _p[2], e3 = _q === void 0 ? { b1: 1000, b4: 200 } : _q; +var _r = ({ f: [1, 2, { f3: 4, f5: 0 }] }).f, f1 = _r[0], f2 = _r[1], _s = _r[2], f4 = _s.f3, f5 = _s.f5; // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable // to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. -var _t = { g: { g1: [1, 2] } }.g.g1, g1 = _t === void 0 ? [undefined, null] : _t; -var _u = { h: { h1: [1, 2] } }.h.h1, h1 = _u === void 0 ? [undefined, null] : _u; +var _t = ({ g: { g1: [1, 2] } }).g.g1, g1 = _t === void 0 ? [undefined, null] : _t; +var _u = ({ h: { h1: [1, 2] } }).h.h1, h1 = _u === void 0 ? [undefined, null] : _u; diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.js b/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.js index 83fb3de04fc..b59c7e1249b 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.js +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.js @@ -68,7 +68,7 @@ var _a = { a1: 10, a2: "world" }, a1 = _a.a1, a2 = _a.a2; var _b = __read([1, [["hello"]], true], 3), a3 = _b[0], _c = __read(_b[1], 1), _d = __read(_c[0], 1), a4 = _d[0], a5 = _b[2]; // The type T associated with a destructuring variable declaration is determined as follows: // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. -var _e = { b1: { b11: "world" } }.b1, b11 = (_e === void 0 ? { b11: "string" } : _e).b11; +var _e = ({ b1: { b11: "world" } }).b1, b11 = (_e === void 0 ? { b11: "string" } : _e).b11; var temp = { t1: true, t2: "false" }; var _f = __read([3, false, { t1: false, t2: "hello" }], 3), _g = _f[0], b2 = _g === void 0 ? 3 : _g, _h = _f[1], b3 = _h === void 0 ? true : _h, _j = _f[2], b4 = _j === void 0 ? temp : _j; var _k = __read([undefined, undefined, undefined], 3), _l = _k[0], b5 = _l === void 0 ? 3 : _l, _m = _k[1], b6 = _m === void 0 ? true : _m, _o = _k[2], b7 = _o === void 0 ? temp : _o; @@ -88,10 +88,10 @@ var _r = __read([1, "string"], 2), d1 = _r[0], d2 = _r[1]; var temp1 = [true, false, true]; var _s = __read(__spread([1, "string"], temp1), 2), d3 = _s[0], d4 = _s[1]; // Combining both forms of destructuring, -var _t = __read({ e: [1, 2, { b1: 4, b4: 0 }] }.e, 3), e1 = _t[0], e2 = _t[1], _u = _t[2], e3 = _u === void 0 ? { b1: 1000, b4: 200 } : _u; -var _v = __read({ f: [1, 2, { f3: 4, f5: 0 }] }.f, 4), f1 = _v[0], f2 = _v[1], _w = _v[2], f4 = _w.f3, f5 = _w.f5; +var _t = __read(({ e: [1, 2, { b1: 4, b4: 0 }] }).e, 3), e1 = _t[0], e2 = _t[1], _u = _t[2], e3 = _u === void 0 ? { b1: 1000, b4: 200 } : _u; +var _v = __read(({ f: [1, 2, { f3: 4, f5: 0 }] }).f, 4), f1 = _v[0], f2 = _v[1], _w = _v[2], f4 = _w.f3, f5 = _w.f5; // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable // to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. -var _x = { g: { g1: [1, 2] } }.g.g1, g1 = _x === void 0 ? [undefined, null] : _x; -var _y = { h: { h1: [1, 2] } }.h.h1, h1 = _y === void 0 ? [undefined, null] : _y; +var _x = ({ g: { g1: [1, 2] } }).g.g1, g1 = _x === void 0 ? [undefined, null] : _x; +var _y = ({ h: { h1: [1, 2] } }).h.h1, h1 = _y === void 0 ? [undefined, null] : _y; diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.js b/tests/baselines/reference/destructuringVariableDeclaration2.js index a4fadd850d7..b3d4152892a 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration2.js +++ b/tests/baselines/reference/destructuringVariableDeclaration2.js @@ -35,4 +35,4 @@ var _g = [1, 2, { c3: 4, c5: 0 }], c1 = _g[0], c2 = _g[1], _h = _g[2], c4 = _h.c // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable // to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. -var _j = { d: { d1: [1, 2] } }.d.d1, d1 = _j === void 0 ? ["string", null] : _j; // Error +var _j = ({ d: { d1: [1, 2] } }).d.d1, d1 = _j === void 0 ? ["string", null] : _j; // Error diff --git a/tests/baselines/reference/downlevelLetConst12.js b/tests/baselines/reference/downlevelLetConst12.js index bdc33aaba9d..3ab90cee98d 100644 --- a/tests/baselines/reference/downlevelLetConst12.js +++ b/tests/baselines/reference/downlevelLetConst12.js @@ -16,6 +16,6 @@ const {a: baz4} = { a: 1 }; var foo; var bar = 1; var baz = [][0]; -var baz2 = { a: 1 }.a; +var baz2 = ({ a: 1 }).a; var baz3 = [][0]; -var baz4 = { a: 1 }.a; +var baz4 = ({ a: 1 }).a; diff --git a/tests/baselines/reference/downlevelLetConst13.js b/tests/baselines/reference/downlevelLetConst13.js index 251468519ad..64d169c4013 100644 --- a/tests/baselines/reference/downlevelLetConst13.js +++ b/tests/baselines/reference/downlevelLetConst13.js @@ -26,14 +26,14 @@ exports.foo = 10; exports.bar = "123"; exports.bar1 = [1][0]; exports.bar2 = [2][0]; -exports.bar3 = { a: 1 }.a; -exports.bar4 = { a: 1 }.a; +exports.bar3 = ({ a: 1 }).a; +exports.bar4 = ({ a: 1 }).a; var M; (function (M) { M.baz = 100; M.baz2 = true; M.bar5 = [1][0]; M.bar6 = [2][0]; - M.bar7 = { a: 1 }.a; - M.bar8 = { a: 1 }.a; + M.bar7 = ({ a: 1 }).a; + M.bar8 = ({ a: 1 }).a; })(M = exports.M || (exports.M = {})); diff --git a/tests/baselines/reference/downlevelLetConst14.js b/tests/baselines/reference/downlevelLetConst14.js index cddfb967217..0d671dbaaa7 100644 --- a/tests/baselines/reference/downlevelLetConst14.js +++ b/tests/baselines/reference/downlevelLetConst14.js @@ -65,9 +65,9 @@ var z0, z1, z2, z3; use(z0_1); var z1_1 = [1][0]; use(z1_1); - var z2_1 = { a: 1 }.a; + var z2_1 = ({ a: 1 }).a; use(z2_1); - var z3_1 = { a: 1 }.a; + var z3_1 = ({ a: 1 }).a; use(z3_1); } use(x); @@ -82,7 +82,7 @@ var y = true; var z6_1 = [true][0]; { var y_2 = 1; - var z6_2 = { a: 1 }.a; + var z6_2 = ({ a: 1 }).a; use(y_2); use(z6_2); } @@ -98,7 +98,7 @@ var z5 = 1; var z5_1 = [5][0]; { var _z = 1; - var _z5 = { a: 1 }.a; + var _z5 = ({ a: 1 }).a; // try to step on generated name use(_z); } diff --git a/tests/baselines/reference/downlevelLetConst15.js b/tests/baselines/reference/downlevelLetConst15.js index 807f49bf84e..bd70cfe767c 100644 --- a/tests/baselines/reference/downlevelLetConst15.js +++ b/tests/baselines/reference/downlevelLetConst15.js @@ -65,9 +65,9 @@ var z0, z1, z2, z3; use(z0_1); var z1_1 = [{ a: 1 }][0].a; use(z1_1); - var z2_1 = { a: 1 }.a; + var z2_1 = ({ a: 1 }).a; use(z2_1); - var z3_1 = { a: { b: 1 } }.a.b; + var z3_1 = ({ a: { b: 1 } }).a.b; use(z3_1); } use(x); @@ -82,7 +82,7 @@ var y = true; var z6_1 = [true][0]; { var y_2 = 1; - var z6_2 = { a: 1 }.a; + var z6_2 = ({ a: 1 }).a; use(y_2); use(z6_2); } @@ -98,7 +98,7 @@ var z5 = 1; var z5_1 = [5][0]; { var _z = 1; - var _z5 = { a: 1 }.a; + var _z5 = ({ a: 1 }).a; // try to step on generated name use(_z); } diff --git a/tests/baselines/reference/downlevelLetConst16.js b/tests/baselines/reference/downlevelLetConst16.js index 338489b20c3..0231d98fec2 100644 --- a/tests/baselines/reference/downlevelLetConst16.js +++ b/tests/baselines/reference/downlevelLetConst16.js @@ -240,7 +240,7 @@ function foo1() { use(x); var y = [1][0]; use(y); - var z = { a: 1 }.a; + var z = ({ a: 1 }).a; use(z); } function foo2() { @@ -249,7 +249,7 @@ function foo2() { use(x_1); var y_1 = [1][0]; use(y_1); - var z_1 = { a: 1 }.a; + var z_1 = ({ a: 1 }).a; use(z_1); } use(x); @@ -262,7 +262,7 @@ var A = /** @class */ (function () { use(x); var y = [1][0]; use(y); - var z = { a: 1 }.a; + var z = ({ a: 1 }).a; use(z); }; A.prototype.m2 = function () { @@ -271,7 +271,7 @@ var A = /** @class */ (function () { use(x_2); var y_2 = [1][0]; use(y_2); - var z_2 = { a: 1 }.a; + var z_2 = ({ a: 1 }).a; use(z_2); } use(x); @@ -286,7 +286,7 @@ var B = /** @class */ (function () { use(x); var y = [1][0]; use(y); - var z = { a: 1 }.a; + var z = ({ a: 1 }).a; use(z); }; B.prototype.m2 = function () { @@ -295,7 +295,7 @@ var B = /** @class */ (function () { use(x_3); var y_3 = [1][0]; use(y_3); - var z_3 = { a: 1 }.a; + var z_3 = ({ a: 1 }).a; use(z_3); } use(x); @@ -307,7 +307,7 @@ function bar1() { use(x); var y = [1][0]; use(y); - var z = { a: 1 }.a; + var z = ({ a: 1 }).a; use(z); } function bar2() { @@ -316,7 +316,7 @@ function bar2() { use(x_4); var y_4 = [1][0]; use(y_4); - var z_4 = { a: 1 }.a; + var z_4 = ({ a: 1 }).a; use(z_4); } use(x); @@ -327,7 +327,7 @@ var M1; use(x); var y = [1][0]; use(y); - var z = { a: 1 }.a; + var z = ({ a: 1 }).a; use(z); })(M1 || (M1 = {})); var M2; @@ -337,7 +337,7 @@ var M2; use(x_5); var y_5 = [1][0]; use(y_5); - var z_5 = { a: 1 }.a; + var z_5 = ({ a: 1 }).a; use(z_5); } use(x); @@ -348,7 +348,7 @@ var M3; use(x); var y = [1][0]; use(y); - var z = { a: 1 }.a; + var z = ({ a: 1 }).a; use(z); })(M3 || (M3 = {})); var M4; @@ -358,7 +358,7 @@ var M4; use(x_6); var y_6 = [1][0]; use(y_6); - var z_6 = { a: 1 }.a; + var z_6 = ({ a: 1 }).a; use(z_6); } use(x); @@ -372,7 +372,7 @@ function foo3() { for (var y_7 = [][0];;) { use(y_7); } - for (var z_7 = { a: 1 }.a;;) { + for (var z_7 = ({ a: 1 }).a;;) { use(z_7); } use(x); @@ -384,7 +384,7 @@ function foo4() { for (var y_8 = [][0];;) { use(y_8); } - for (var z_8 = { a: 1 }.a;;) { + for (var z_8 = ({ a: 1 }).a;;) { use(z_8); } use(x); diff --git a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.js b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.js index 182e678b7bf..5d99dad3c0c 100644 --- a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.js +++ b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.js @@ -3,5 +3,5 @@ (x) => ({ "1": "one", "2": "two" } as { [key: string]: string }).x; //// [emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.js] -(function (x) { return ({ "1": "one", "2": "two" }[x]); }); -(function (x) { return ({ "1": "one", "2": "two" }.x); }); +(function (x) { return ({ "1": "one", "2": "two" })[x]; }); +(function (x) { return ({ "1": "one", "2": "two" }).x; }); diff --git a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.js b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.js index 8d7999b0da7..dc3891a9bd4 100644 --- a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.js +++ b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.js @@ -3,5 +3,5 @@ (x) => ({ "1": "one", "2": "two" } as { [key: string]: string }).x; //// [emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.js] -(x) => ({ "1": "one", "2": "two" }[x]); -(x) => ({ "1": "one", "2": "two" }.x); +(x) => ({ "1": "one", "2": "two" })[x]; +(x) => ({ "1": "one", "2": "two" }).x; diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js index 60044ac5dc4..7572b0c3af1 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js @@ -9,7 +9,7 @@ function f() { //// [emitArrowFunctionWhenUsingArguments17.js] function f() { - var arguments = { arguments: "hello" }.arguments; + var arguments = ({ arguments: "hello" }).arguments; if (Math.random()) { return function () { return arguments[0]; }; } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js index a88a01c7a56..3af9c580231 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js @@ -8,7 +8,7 @@ function f() { //// [emitArrowFunctionWhenUsingArguments18.js] function f() { - var args = { arguments: arguments }.arguments; + var args = ({ arguments: arguments }).arguments; if (Math.random()) { return function () { return arguments; }; } diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.js b/tests/baselines/reference/initializePropertiesWithRenamedLet.js index d6c53b7d525..0ed325b2a31 100644 --- a/tests/baselines/reference/initializePropertiesWithRenamedLet.js +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.js @@ -24,9 +24,9 @@ if (true) { } var x, y, z; if (true) { - var x_1 = { x: 0 }.x; - var y_1 = { y: 0 }.y; + var x_1 = ({ x: 0 }).x; + var y_1 = ({ y: 0 }).y; var z_1; - (z_1 = { z: 0 }.z); - (z_1 = { z: 0 }.z); + (z_1 = ({ z: 0 }).z); + (z_1 = ({ z: 0 }).z); } diff --git a/tests/baselines/reference/letInNonStrictMode.js b/tests/baselines/reference/letInNonStrictMode.js index 8e4920cc220..3627a72e7ff 100644 --- a/tests/baselines/reference/letInNonStrictMode.js +++ b/tests/baselines/reference/letInNonStrictMode.js @@ -4,4 +4,4 @@ let {a: y} = {a: 1}; //// [letInNonStrictMode.js] var x = [1][0]; -var y = { a: 1 }.a; +var y = ({ a: 1 }).a; diff --git a/tests/baselines/reference/literalTypesAndTypeAssertions.js b/tests/baselines/reference/literalTypesAndTypeAssertions.js index ab6a82852a5..6c95fd45802 100644 --- a/tests/baselines/reference/literalTypesAndTypeAssertions.js +++ b/tests/baselines/reference/literalTypesAndTypeAssertions.js @@ -22,7 +22,7 @@ var obj = { }; var x1 = 1; var x2 = 1; -var _a = { a: "foo" }.a, a = _a === void 0 ? "foo" : _a; -var _b = { b: "bar" }.b, b = _b === void 0 ? "foo" : _b; -var _c = { c: "bar" }.c, c = _c === void 0 ? "foo" : _c; -var _d = { d: "bar" }.d, d = _d === void 0 ? "foo" : _d; +var _a = ({ a: "foo" }).a, a = _a === void 0 ? "foo" : _a; +var _b = ({ b: "bar" }).b, b = _b === void 0 ? "foo" : _b; +var _c = ({ c: "bar" }).c, c = _c === void 0 ? "foo" : _c; +var _d = ({ d: "bar" }).d, d = _d === void 0 ? "foo" : _d; diff --git a/tests/baselines/reference/missingAndExcessProperties.js b/tests/baselines/reference/missingAndExcessProperties.js index daefe18eed7..28e0f13b4bd 100644 --- a/tests/baselines/reference/missingAndExcessProperties.js +++ b/tests/baselines/reference/missingAndExcessProperties.js @@ -54,16 +54,16 @@ function f2() { // Excess properties function f3() { var _a = { x: 0, y: 0 }; - var x = { x: 0, y: 0 }.x; - var y = { x: 0, y: 0 }.y; + var x = ({ x: 0, y: 0 }).x; + var y = ({ x: 0, y: 0 }).y; var _b = { x: 0, y: 0 }, x = _b.x, y = _b.y; } // Excess properties function f4() { var x, y; ({ x: 0, y: 0 }); - (x = { x: 0, y: 0 }.x); - (y = { x: 0, y: 0 }.y); + (x = ({ x: 0, y: 0 }).x); + (y = ({ x: 0, y: 0 }).y); (_a = { x: 0, y: 0 }, x = _a.x, y = _a.y); var _a; } diff --git a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.js b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.js index 85358df666e..1dbc933cbf5 100644 --- a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.js +++ b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.js @@ -16,5 +16,5 @@ var a = (void 0)[0], b = (void 0).b, c, d; // error var _a = (void 0)[0], a1 = _a === void 0 ? undefined : _a, _b = (void 0).b1, b1 = _b === void 0 ? null : _b, c1 = undefined, d1 = null; // error var a2 = (void 0)[0], b2 = (void 0).b2, c2, d2; var b3 = (void 0).b3, c3; // error in type instead -var a4 = [undefined][0], b4 = { b4: null }.b4, c4 = undefined, d4 = null; // error +var a4 = [undefined][0], b4 = ({ b4: null }).b4, c4 = undefined, d4 = null; // error var _c = [][0], a5 = _c === void 0 ? undefined : _c; // error diff --git a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.js b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.js index 79ee0b8830f..81d8ba6386f 100644 --- a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.js +++ b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.js @@ -22,4 +22,4 @@ var _p = { x: 1, y: 2, z: 3 }, x = _p.x, y = _p.y, z = _p.z; // no error var _q = { x1: 1, y1: 2, z1: 3 }, _r = _q.x1, x1 = _r === void 0 ? 10 : _r, _s = _q.y1, y1 = _s === void 0 ? 10 : _s, _t = _q.z1, z1 = _t === void 0 ? 10 : _t; // no error var _u = { x2: 1, y2: 2, z2: 3 }, _v = _u.x2, x2 = _v === void 0 ? undefined : _v, _w = _u.y2, y2 = _w === void 0 ? undefined : _w, _x = _u.z2, z2 = _x === void 0 ? undefined : _x; // no error var _y = { x3: 1, y3: 2, z3: 3 }, _z = _y.x3, x3 = _z === void 0 ? undefined : _z, _0 = _y.y3, y3 = _0 === void 0 ? null : _0, _1 = _y.z3, z3 = _1 === void 0 ? undefined : _1; // no error -var x4 = { x4: undefined }.x4, y4 = { y4: null }.y4; // no error +var x4 = ({ x4: undefined }).x4, y4 = ({ y4: null }).y4; // no error diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.js index ec0cae158fc..2bac381b603 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.js +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.js @@ -2,4 +2,4 @@ var { while } = { while: 1 } //// [objectBindingPatternKeywordIdentifiers01.js] -var = { "while": 1 }["while"]; +var = ({ "while": 1 })["while"]; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.js index 6c9a539bb69..d1fb037dfbe 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.js +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.js @@ -2,4 +2,4 @@ var { "while" } = { while: 1 } //// [objectBindingPatternKeywordIdentifiers03.js] -var = { "while": 1 }["while"]; +var = ({ "while": 1 })["while"]; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.js index 08f8e632f29..146ac4b2077 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.js +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.js @@ -2,4 +2,4 @@ var { as } = { as: 1 } //// [objectBindingPatternKeywordIdentifiers05.js] -var as = { as: 1 }.as; +var as = ({ as: 1 }).as; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.js index 9f29dfff1f8..d465161f4ce 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.js +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.js @@ -2,4 +2,4 @@ var { as: as } = { as: 1 } //// [objectBindingPatternKeywordIdentifiers06.js] -var as = { as: 1 }.as; +var as = ({ as: 1 }).as; diff --git a/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js index e1cae9c73fe..b3c44600d1d 100644 --- a/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js +++ b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js @@ -15,9 +15,9 @@ if (true) { var x_1; if (true) { var x = 0; // Error - var _a = { x: 0 }.x, x = _a === void 0 ? 0 : _a; // Error - var _b = { x: 0 }.x, x = _b === void 0 ? 0 : _b; // Error - var x = { x: 0 }.x; // Error - var x = { x: 0 }.x; // Error + var _a = ({ x: 0 }).x, x = _a === void 0 ? 0 : _a; // Error + var _b = ({ x: 0 }).x, x = _b === void 0 ? 0 : _b; // Error + var x = ({ x: 0 }).x; // Error + var x = ({ x: 0 }).x; // Error } } diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js index a92f3b6a63d..7e1c7622cf7 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js @@ -174,22 +174,22 @@ function foo({a = 4, b = { x: 5 }}) { }); (function () { var y; - (_a = { y: 1 }.y, y = _a === void 0 ? 5 : _a); + (_a = ({ y: 1 }).y, y = _a === void 0 ? 5 : _a); var _a; }); (function () { var y; - (_a = { y: 1 }.y, y = _a === void 0 ? 5 : _a); + (_a = ({ y: 1 }).y, y = _a === void 0 ? 5 : _a); var _a; }); (function () { var y0; - (_a = { y0: 1 }.y0, y0 = _a === void 0 ? 5 : _a); + (_a = ({ y0: 1 }).y0, y0 = _a === void 0 ? 5 : _a); var _a; }); (function () { var y0; - (_a = { y0: 1 }.y0, y0 = _a === void 0 ? 5 : _a); + (_a = ({ y0: 1 }).y0, y0 = _a === void 0 ? 5 : _a); var _a; }); (function () { @@ -224,12 +224,12 @@ function foo({a = 4, b = { x: 5 }}) { }); (function () { var z; - (_a = { z: { x: 1 } }.z, z = _a === void 0 ? { x: 5 } : _a); + (_a = ({ z: { x: 1 } }).z, z = _a === void 0 ? { x: 5 } : _a); var _a; }); (function () { var z; - (_a = { z: { x: 1 } }.z, z = _a === void 0 ? { x: 5 } : _a); + (_a = ({ z: { x: 1 } }).z, z = _a === void 0 ? { x: 5 } : _a); var _a; }); (function () { diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js index ca29b2eabd8..46d9e251439 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js @@ -81,7 +81,7 @@ for (var nameA = robot.name, i = 0; i < 1; i++) { for (var nameA = getRobot().name, i = 0; i < 1; i++) { console.log(nameA); } -for (var nameA = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) { +for (var nameA = ({ name: "trimmer", skill: "trimming" }).name, i = 0; i < 1; i++) { console.log(nameA); } for (var _a = multiRobot.skills, primaryA = _a.primary, secondaryA = _a.secondary, i = 0; i < 1; i++) { @@ -90,7 +90,7 @@ for (var _a = multiRobot.skills, primaryA = _a.primary, secondaryA = _a.secondar for (var _b = getMultiRobot().skills, primaryA = _b.primary, secondaryA = _b.secondary, i = 0; i < 1; i++) { console.log(primaryA); } -for (var _c = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { +for (var _c = ({ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }).skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { console.log(primaryA); } for (var nameA = robot.name, skillA = robot.skill, i = 0; i < 1; i++) { diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map index a0295550f0b..e0fa0db3b1a 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForObjectBindingPattern.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern.ts"],"names":[],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt index 5ea0b7e360d..94cab1030c8 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt @@ -396,33 +396,33 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} 1 >Emitted(14, 1) Source(31, 1) + SourceIndex(0) 2 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) --- ->>>for (var nameA = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) { +>>>for (var nameA = ({ name: "trimmer", skill: "trimming" }).name, i = 0; i < 1; i++) { 1-> 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ +19> ^ 1-> > 2 >for @@ -430,38 +430,38 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 4 > (let { 5 > 6 > name: nameA -7 > } = { name: "trimmer", skill: "trimming" }, -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +7 > } = { name: "trimmer", skill: "trimming" }, +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) +19> { 1->Emitted(15, 1) Source(32, 1) + SourceIndex(0) 2 >Emitted(15, 4) Source(32, 4) + SourceIndex(0) 3 >Emitted(15, 5) Source(32, 5) + SourceIndex(0) 4 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) 5 >Emitted(15, 10) Source(32, 11) + SourceIndex(0) -6 >Emitted(15, 61) Source(32, 22) + SourceIndex(0) -7 >Emitted(15, 63) Source(32, 74) + SourceIndex(0) -8 >Emitted(15, 64) Source(32, 75) + SourceIndex(0) -9 >Emitted(15, 67) Source(32, 78) + SourceIndex(0) -10>Emitted(15, 68) Source(32, 79) + SourceIndex(0) -11>Emitted(15, 70) Source(32, 81) + SourceIndex(0) -12>Emitted(15, 71) Source(32, 82) + SourceIndex(0) -13>Emitted(15, 74) Source(32, 85) + SourceIndex(0) -14>Emitted(15, 75) Source(32, 86) + SourceIndex(0) -15>Emitted(15, 77) Source(32, 88) + SourceIndex(0) -16>Emitted(15, 78) Source(32, 89) + SourceIndex(0) -17>Emitted(15, 80) Source(32, 91) + SourceIndex(0) -18>Emitted(15, 82) Source(32, 93) + SourceIndex(0) -19>Emitted(15, 83) Source(32, 94) + SourceIndex(0) +6 >Emitted(15, 63) Source(32, 22) + SourceIndex(0) +7 >Emitted(15, 65) Source(32, 74) + SourceIndex(0) +8 >Emitted(15, 66) Source(32, 75) + SourceIndex(0) +9 >Emitted(15, 69) Source(32, 78) + SourceIndex(0) +10>Emitted(15, 70) Source(32, 79) + SourceIndex(0) +11>Emitted(15, 72) Source(32, 81) + SourceIndex(0) +12>Emitted(15, 73) Source(32, 82) + SourceIndex(0) +13>Emitted(15, 76) Source(32, 85) + SourceIndex(0) +14>Emitted(15, 77) Source(32, 86) + SourceIndex(0) +15>Emitted(15, 79) Source(32, 88) + SourceIndex(0) +16>Emitted(15, 80) Source(32, 89) + SourceIndex(0) +17>Emitted(15, 82) Source(32, 91) + SourceIndex(0) +18>Emitted(15, 84) Source(32, 93) + SourceIndex(0) +19>Emitted(15, 85) Source(32, 94) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -711,37 +711,37 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} 1 >Emitted(23, 1) Source(40, 1) + SourceIndex(0) 2 >Emitted(23, 2) Source(40, 2) + SourceIndex(0) --- ->>>for (var _c = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { +>>>for (var _c = ({ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }).skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { 1-> 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ 1-> > 2 >for @@ -749,48 +749,48 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 4 > (let { 5 > 6 > skills: { primary: primaryA, secondary: secondaryA } -7 > -8 > primary: primaryA -9 > , -10> secondary: secondaryA -11> } } = - > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, - > -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +11> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { 1->Emitted(24, 1) Source(41, 1) + SourceIndex(0) 2 >Emitted(24, 4) Source(41, 4) + SourceIndex(0) 3 >Emitted(24, 5) Source(41, 5) + SourceIndex(0) 4 >Emitted(24, 6) Source(41, 12) + SourceIndex(0) 5 >Emitted(24, 10) Source(41, 12) + SourceIndex(0) -6 >Emitted(24, 95) Source(41, 64) + SourceIndex(0) -7 >Emitted(24, 97) Source(41, 22) + SourceIndex(0) -8 >Emitted(24, 118) Source(41, 39) + SourceIndex(0) -9 >Emitted(24, 120) Source(41, 41) + SourceIndex(0) -10>Emitted(24, 145) Source(41, 62) + SourceIndex(0) -11>Emitted(24, 147) Source(43, 5) + SourceIndex(0) -12>Emitted(24, 148) Source(43, 6) + SourceIndex(0) -13>Emitted(24, 151) Source(43, 9) + SourceIndex(0) -14>Emitted(24, 152) Source(43, 10) + SourceIndex(0) -15>Emitted(24, 154) Source(43, 12) + SourceIndex(0) -16>Emitted(24, 155) Source(43, 13) + SourceIndex(0) -17>Emitted(24, 158) Source(43, 16) + SourceIndex(0) -18>Emitted(24, 159) Source(43, 17) + SourceIndex(0) -19>Emitted(24, 161) Source(43, 19) + SourceIndex(0) -20>Emitted(24, 162) Source(43, 20) + SourceIndex(0) -21>Emitted(24, 164) Source(43, 22) + SourceIndex(0) -22>Emitted(24, 166) Source(43, 24) + SourceIndex(0) -23>Emitted(24, 167) Source(43, 25) + SourceIndex(0) +6 >Emitted(24, 97) Source(41, 64) + SourceIndex(0) +7 >Emitted(24, 99) Source(41, 22) + SourceIndex(0) +8 >Emitted(24, 120) Source(41, 39) + SourceIndex(0) +9 >Emitted(24, 122) Source(41, 41) + SourceIndex(0) +10>Emitted(24, 147) Source(41, 62) + SourceIndex(0) +11>Emitted(24, 149) Source(43, 5) + SourceIndex(0) +12>Emitted(24, 150) Source(43, 6) + SourceIndex(0) +13>Emitted(24, 153) Source(43, 9) + SourceIndex(0) +14>Emitted(24, 154) Source(43, 10) + SourceIndex(0) +15>Emitted(24, 156) Source(43, 12) + SourceIndex(0) +16>Emitted(24, 157) Source(43, 13) + SourceIndex(0) +17>Emitted(24, 160) Source(43, 16) + SourceIndex(0) +18>Emitted(24, 161) Source(43, 17) + SourceIndex(0) +19>Emitted(24, 163) Source(43, 19) + SourceIndex(0) +20>Emitted(24, 164) Source(43, 20) + SourceIndex(0) +21>Emitted(24, 166) Source(43, 22) + SourceIndex(0) +22>Emitted(24, 168) Source(43, 24) + SourceIndex(0) +23>Emitted(24, 169) Source(43, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js index 785148ba652..3a3ffc6b8d4 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js @@ -112,7 +112,7 @@ for (var _a = robot.name, nameA = _a === void 0 ? "noName" : _a, i = 0; i < 1; i for (var _b = getRobot().name, nameA = _b === void 0 ? "noName" : _b, i = 0; i < 1; i++) { console.log(nameA); } -for (var _c = { name: "trimmer", skill: "trimming" }.name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { +for (var _c = ({ name: "trimmer", skill: "trimming" }).name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { console.log(nameA); } for (var _d = multiRobot.skills, _e = _d === void 0 ? { primary: "none", secondary: "none" } : _d, _f = _e.primary, primaryA = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryA = _g === void 0 ? "secondary" : _g, i = 0; i < 1; i++) { @@ -121,7 +121,7 @@ for (var _d = multiRobot.skills, _e = _d === void 0 ? { primary: "none", seconda for (var _h = getMultiRobot().skills, _j = _h === void 0 ? { primary: "none", secondary: "none" } : _h, _k = _j.primary, primaryA = _k === void 0 ? "primary" : _k, _l = _j.secondary, secondaryA = _l === void 0 ? "secondary" : _l, i = 0; i < 1; i++) { console.log(primaryA); } -for (var _m = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { +for (var _m = ({ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }).skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { console.log(primaryA); } for (var _r = robot.name, nameA = _r === void 0 ? "noName" : _r, _s = robot.skill, skillA = _s === void 0 ? "skill" : _s, i = 0; i < 1; i++) { diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map index 0e96b80e749..ac5719ded6a 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,eAAqB,EAArB,qCAAqB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,oBAAsB,EAAtB,qCAAsB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,gDAAsB,EAAtB,qCAAsB,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,IAAA,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAE3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CACA,IAAA,2BAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CACA,IAAA,qFAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,eAAsB,EAAtB,qCAAsB,EAAE,gBAAuB,EAAvB,qCAAuB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,eAA+D,EAA9D,YAAsB,EAAtB,qCAAsB,EAAE,aAAuB,EAAvB,qCAAuB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,2CAAkG,EAAjG,YAAsB,EAAtB,qCAAsB,EAAE,aAAuB,EAAvB,qCAAuB,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7H,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,IAAA,oBAAsB,EAAtB,qCAAsB,EACtB,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAE3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,oBAMU,EALf,YAAsB,EAAtB,qCAAsB,EACtB,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,+EAMgF,EALrF,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,EAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt index ebe3dccdad7..61eeccd186f 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt @@ -408,35 +408,35 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} 1 >Emitted(14, 1) Source(31, 1) + SourceIndex(0) 2 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) --- ->>>for (var _c = { name: "trimmer", skill: "trimming" }.name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { +>>>for (var _c = ({ name: "trimmer", skill: "trimming" }).name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { 1-> 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ +21> ^ 1-> > 2 >for @@ -444,42 +444,42 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 4 > (let { 5 > 6 > name: nameA = "noName" -7 > -8 > name: nameA = "noName" -9 > } = { name: "trimmer", skill: "trimming" }, -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +7 > +8 > name: nameA = "noName" +9 > } = { name: "trimmer", skill: "trimming" }, +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) +21> { 1->Emitted(15, 1) Source(32, 1) + SourceIndex(0) 2 >Emitted(15, 4) Source(32, 4) + SourceIndex(0) 3 >Emitted(15, 5) Source(32, 5) + SourceIndex(0) 4 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) 5 >Emitted(15, 10) Source(32, 11) + SourceIndex(0) -6 >Emitted(15, 58) Source(32, 33) + SourceIndex(0) -7 >Emitted(15, 60) Source(32, 11) + SourceIndex(0) -8 >Emitted(15, 97) Source(32, 33) + SourceIndex(0) -9 >Emitted(15, 99) Source(32, 85) + SourceIndex(0) -10>Emitted(15, 100) Source(32, 86) + SourceIndex(0) -11>Emitted(15, 103) Source(32, 89) + SourceIndex(0) -12>Emitted(15, 104) Source(32, 90) + SourceIndex(0) -13>Emitted(15, 106) Source(32, 92) + SourceIndex(0) -14>Emitted(15, 107) Source(32, 93) + SourceIndex(0) -15>Emitted(15, 110) Source(32, 96) + SourceIndex(0) -16>Emitted(15, 111) Source(32, 97) + SourceIndex(0) -17>Emitted(15, 113) Source(32, 99) + SourceIndex(0) -18>Emitted(15, 114) Source(32, 100) + SourceIndex(0) -19>Emitted(15, 116) Source(32, 102) + SourceIndex(0) -20>Emitted(15, 118) Source(32, 104) + SourceIndex(0) -21>Emitted(15, 119) Source(32, 105) + SourceIndex(0) +6 >Emitted(15, 60) Source(32, 33) + SourceIndex(0) +7 >Emitted(15, 62) Source(32, 11) + SourceIndex(0) +8 >Emitted(15, 99) Source(32, 33) + SourceIndex(0) +9 >Emitted(15, 101) Source(32, 85) + SourceIndex(0) +10>Emitted(15, 102) Source(32, 86) + SourceIndex(0) +11>Emitted(15, 105) Source(32, 89) + SourceIndex(0) +12>Emitted(15, 106) Source(32, 90) + SourceIndex(0) +13>Emitted(15, 108) Source(32, 92) + SourceIndex(0) +14>Emitted(15, 109) Source(32, 93) + SourceIndex(0) +15>Emitted(15, 112) Source(32, 96) + SourceIndex(0) +16>Emitted(15, 113) Source(32, 97) + SourceIndex(0) +17>Emitted(15, 115) Source(32, 99) + SourceIndex(0) +18>Emitted(15, 116) Source(32, 100) + SourceIndex(0) +19>Emitted(15, 118) Source(32, 102) + SourceIndex(0) +20>Emitted(15, 120) Source(32, 104) + SourceIndex(0) +21>Emitted(15, 121) Source(32, 105) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -785,43 +785,43 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} 1 >Emitted(23, 1) Source(50, 1) + SourceIndex(0) 2 >Emitted(23, 2) Source(50, 2) + SourceIndex(0) --- ->>>for (var _m = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { +>>>for (var _m = ({ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }).skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { 1-> 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^^ -24> ^ -25> ^^ -26> ^ -27> ^^ -28> ^^ -29> ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^^ +24> ^ +25> ^^ +26> ^ +27> ^^ +28> ^^ +29> ^ 1-> > 2 >for @@ -833,65 +833,65 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -7 > -8 > skills: { - > primary: primaryA = "primary", - > secondary: secondaryA = "secondary" - > } = { primary: "none", secondary: "none" } -9 > -10> primary: primaryA = "primary" -11> -12> primary: primaryA = "primary" -13> , - > -14> secondary: secondaryA = "secondary" -15> -16> secondary: secondaryA = "secondary" -17> - > } = { primary: "none", secondary: "none" } - > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, - > -18> i -19> = -20> 0 -21> ; -22> i -23> < -24> 1 -25> ; -26> i -27> ++ -28> ) -29> { +7 > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> primary: primaryA = "primary" +11> +12> primary: primaryA = "primary" +13> , + > +14> secondary: secondaryA = "secondary" +15> +16> secondary: secondaryA = "secondary" +17> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +18> i +19> = +20> 0 +21> ; +22> i +23> < +24> 1 +25> ; +26> i +27> ++ +28> ) +29> { 1->Emitted(24, 1) Source(51, 1) + SourceIndex(0) 2 >Emitted(24, 4) Source(51, 4) + SourceIndex(0) 3 >Emitted(24, 5) Source(51, 5) + SourceIndex(0) 4 >Emitted(24, 6) Source(52, 5) + SourceIndex(0) 5 >Emitted(24, 10) Source(52, 5) + SourceIndex(0) -6 >Emitted(24, 95) Source(55, 47) + SourceIndex(0) -7 >Emitted(24, 97) Source(52, 5) + SourceIndex(0) -8 >Emitted(24, 161) Source(55, 47) + SourceIndex(0) -9 >Emitted(24, 163) Source(53, 9) + SourceIndex(0) -10>Emitted(24, 178) Source(53, 38) + SourceIndex(0) -11>Emitted(24, 180) Source(53, 9) + SourceIndex(0) -12>Emitted(24, 221) Source(53, 38) + SourceIndex(0) -13>Emitted(24, 223) Source(54, 9) + SourceIndex(0) -14>Emitted(24, 240) Source(54, 44) + SourceIndex(0) -15>Emitted(24, 242) Source(54, 9) + SourceIndex(0) -16>Emitted(24, 287) Source(54, 44) + SourceIndex(0) -17>Emitted(24, 289) Source(57, 5) + SourceIndex(0) -18>Emitted(24, 290) Source(57, 6) + SourceIndex(0) -19>Emitted(24, 293) Source(57, 9) + SourceIndex(0) -20>Emitted(24, 294) Source(57, 10) + SourceIndex(0) -21>Emitted(24, 296) Source(57, 12) + SourceIndex(0) -22>Emitted(24, 297) Source(57, 13) + SourceIndex(0) -23>Emitted(24, 300) Source(57, 16) + SourceIndex(0) -24>Emitted(24, 301) Source(57, 17) + SourceIndex(0) -25>Emitted(24, 303) Source(57, 19) + SourceIndex(0) -26>Emitted(24, 304) Source(57, 20) + SourceIndex(0) -27>Emitted(24, 306) Source(57, 22) + SourceIndex(0) -28>Emitted(24, 308) Source(57, 24) + SourceIndex(0) -29>Emitted(24, 309) Source(57, 25) + SourceIndex(0) +6 >Emitted(24, 97) Source(55, 47) + SourceIndex(0) +7 >Emitted(24, 99) Source(52, 5) + SourceIndex(0) +8 >Emitted(24, 163) Source(55, 47) + SourceIndex(0) +9 >Emitted(24, 165) Source(53, 9) + SourceIndex(0) +10>Emitted(24, 180) Source(53, 38) + SourceIndex(0) +11>Emitted(24, 182) Source(53, 9) + SourceIndex(0) +12>Emitted(24, 223) Source(53, 38) + SourceIndex(0) +13>Emitted(24, 225) Source(54, 9) + SourceIndex(0) +14>Emitted(24, 242) Source(54, 44) + SourceIndex(0) +15>Emitted(24, 244) Source(54, 9) + SourceIndex(0) +16>Emitted(24, 289) Source(54, 44) + SourceIndex(0) +17>Emitted(24, 291) Source(57, 5) + SourceIndex(0) +18>Emitted(24, 292) Source(57, 6) + SourceIndex(0) +19>Emitted(24, 295) Source(57, 9) + SourceIndex(0) +20>Emitted(24, 296) Source(57, 10) + SourceIndex(0) +21>Emitted(24, 298) Source(57, 12) + SourceIndex(0) +22>Emitted(24, 299) Source(57, 13) + SourceIndex(0) +23>Emitted(24, 302) Source(57, 16) + SourceIndex(0) +24>Emitted(24, 303) Source(57, 17) + SourceIndex(0) +25>Emitted(24, 305) Source(57, 19) + SourceIndex(0) +26>Emitted(24, 306) Source(57, 20) + SourceIndex(0) +27>Emitted(24, 308) Source(57, 22) + SourceIndex(0) +28>Emitted(24, 310) Source(57, 24) + SourceIndex(0) +29>Emitted(24, 311) Source(57, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js index a20e7578d93..164159655b2 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js @@ -2,5 +2,5 @@ var {x} = { x: 20 }; //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js] -var x = { x: 20 }.x; +var x = ({ x: 20 }).x; //# sourceMappingURL=sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map index b0a552391c9..b1104fa4eab 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.ts"],"names":[],"mappings":"AAAK,IAAA,eAAC,CAAc"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.ts"],"names":[],"mappings":"AAAK,IAAA,iBAAC,CAAc"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.sourcemap.txt index 0c554c986a4..fb41dc6233f 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.sourcemap.txt @@ -8,19 +8,19 @@ sources: sourceMapValidationDestructuringVariableStatementObjectBindingPattern1. emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js sourceFile:sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.ts ------------------------------------------------------------------- ->>>var x = { x: 20 }.x; +>>>var x = ({ x: 20 }).x; 1 > 2 >^^^^ -3 > ^^^^^^^^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >var { 2 > 3 > x -4 > } = { x: 20 }; +4 > } = { x: 20 }; 1 >Emitted(1, 1) Source(1, 6) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 20) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) +3 >Emitted(1, 22) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 23) Source(1, 21) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js index 44295762d6d..771bda92ef4 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js @@ -3,6 +3,6 @@ var {x} = { x: 20 }; var { a, b } = { a: 30, b: 40 }; //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js] -var x = { x: 20 }.x; +var x = ({ x: 20 }).x; var _a = { a: 30, b: 40 }, a = _a.a, b = _a.b; //# sourceMappingURL=sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map index eb36a3b9022..5acc1fea7fa 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.ts"],"names":[],"mappings":"AAAK,IAAA,eAAC,CAAc;AAChB,IAAA,qBAA2B,EAAzB,QAAC,EAAE,QAAC,CAAsB"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.ts"],"names":[],"mappings":"AAAK,IAAA,iBAAC,CAAc;AAChB,IAAA,qBAA2B,EAAzB,QAAC,EAAE,QAAC,CAAsB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.sourcemap.txt index 2390f91a8b1..51c431c5da5 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.sourcemap.txt @@ -8,20 +8,20 @@ sources: sourceMapValidationDestructuringVariableStatementObjectBindingPattern2. emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js sourceFile:sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.ts ------------------------------------------------------------------- ->>>var x = { x: 20 }.x; +>>>var x = ({ x: 20 }).x; 1 > 2 >^^^^ -3 > ^^^^^^^^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >var { 2 > 3 > x -4 > } = { x: 20 }; +4 > } = { x: 20 }; 1 >Emitted(1, 1) Source(1, 6) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 20) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) +3 >Emitted(1, 22) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 23) Source(1, 21) + SourceIndex(0) --- >>>var _a = { a: 30, b: 40 }, a = _a.a, b = _a.b; 1-> diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js index 88a5bce4dcc..3ef30f1a8aa 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js @@ -2,5 +2,5 @@ var {x = 500} = { x: 20 }; //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js] -var _a = { x: 20 }.x, x = _a === void 0 ? 500 : _a; +var _a = ({ x: 20 }).x, x = _a === void 0 ? 500 : _a; //# sourceMappingURL=sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map index 1faa8f8e71a..d974f0b7c78 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.ts"],"names":[],"mappings":"AAAK,IAAA,gBAAO,EAAP,4BAAO,CAAc"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.ts"],"names":[],"mappings":"AAAK,IAAA,kBAAO,EAAP,4BAAO,CAAc"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.sourcemap.txt index d58e756de42..7c06d77cf83 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.sourcemap.txt @@ -8,25 +8,25 @@ sources: sourceMapValidationDestructuringVariableStatementObjectBindingPattern3. emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js sourceFile:sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.ts ------------------------------------------------------------------- ->>>var _a = { x: 20 }.x, x = _a === void 0 ? 500 : _a; +>>>var _a = ({ x: 20 }).x, x = _a === void 0 ? 500 : _a; 1 > 2 >^^^^ -3 > ^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >var { 2 > 3 > x = 500 -4 > -5 > x = 500 -6 > } = { x: 20 }; +4 > +5 > x = 500 +6 > } = { x: 20 }; 1 >Emitted(1, 1) Source(1, 6) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 21) Source(1, 13) + SourceIndex(0) -4 >Emitted(1, 23) Source(1, 6) + SourceIndex(0) -5 >Emitted(1, 51) Source(1, 13) + SourceIndex(0) -6 >Emitted(1, 52) Source(1, 27) + SourceIndex(0) +3 >Emitted(1, 23) Source(1, 13) + SourceIndex(0) +4 >Emitted(1, 25) Source(1, 6) + SourceIndex(0) +5 >Emitted(1, 53) Source(1, 13) + SourceIndex(0) +6 >Emitted(1, 54) Source(1, 27) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/strictModeReservedWordInDestructuring.js b/tests/baselines/reference/strictModeReservedWordInDestructuring.js index 78c8ab788ca..7186683bdff 100644 --- a/tests/baselines/reference/strictModeReservedWordInDestructuring.js +++ b/tests/baselines/reference/strictModeReservedWordInDestructuring.js @@ -11,7 +11,7 @@ var { public: a, protected: b } = { public: 1, protected: 2 }; //// [strictModeReservedWordInDestructuring.js] "use strict"; var public = [1][0]; -var public = { x: 1 }.x; +var public = ({ x: 1 }).x; var private = [["hello"]][0][0]; var _a = { y: { s: 1 }, z: { o: { p: 'h' } } }, static = _a.y.s, package = _a.z.o.p; var _b = { public: 1, protected: 2 }, public = _b.public, protected = _b.protected; diff --git a/tests/baselines/reference/strictModeUseContextualKeyword.js b/tests/baselines/reference/strictModeUseContextualKeyword.js index 6d5d3dfd5e0..0e28f5828fd 100644 --- a/tests/baselines/reference/strictModeUseContextualKeyword.js +++ b/tests/baselines/reference/strictModeUseContextualKeyword.js @@ -27,5 +27,5 @@ function F() { function as() { } } function H() { - var as = { as: 1 }.as; + var as = ({ as: 1 }).as; } diff --git a/tests/baselines/reference/templateStringInObjectLiteral.js b/tests/baselines/reference/templateStringInObjectLiteral.js index 0381e9a95e7..5a096b0adfa 100644 --- a/tests/baselines/reference/templateStringInObjectLiteral.js +++ b/tests/baselines/reference/templateStringInObjectLiteral.js @@ -5,8 +5,8 @@ var x = { } //// [templateStringInObjectLiteral.js] -var x = (_a = ["b"], _a.raw = ["b"], { +var x = (_a = ["b"], _a.raw = ["b"], ({ a: "abc" + 123 + "def" -}(_a)); +})(_a)); 321; var _a; From 01657e20362147aa94c66829a1dd531612319ad8 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Mon, 28 Aug 2017 23:43:29 +0100 Subject: [PATCH 6/9] Fix typo in comment --- src/compiler/factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 0c863b38ca3..5fe5fa03225 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -3817,7 +3817,7 @@ namespace ts { // new C.x -> not the same as (new C).x // // ObjectLiteral: - // {a:1}.toString() -> is incorrect syntax, should be ({a:3}).toString() + // {a:1}.toString() -> is incorrect syntax, should be ({a:1}).toString() // const emittedExpression = skipPartiallyEmittedExpressions(expression); if (isLeftHandSideExpression(emittedExpression) From 4966c65b7fa7e8370e4861a994fc1d55b9a5cc18 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 8 Sep 2017 20:15:39 +0100 Subject: [PATCH 7/9] Revert changes to other baselines --- .../reference/assignmentTypeNarrowing.js | 8 +- .../reference/asyncMethodWithSuper_es5.js | 4 +- .../blockScopedBindingUsedBeforeDef.js | 4 +- .../computedPropertiesInDestructuring1.js | 12 +- .../computedPropertiesInDestructuring2.js | 2 +- .../contextuallyTypedBindingInitializer.js | 2 +- ...extuallyTypedBindingInitializerNegative.js | 2 +- .../controlFlowDestructuringDeclaration.js | 18 +- ...onEmitDestructuringObjectLiteralPattern.js | 8 +- ...nEmitDestructuringObjectLiteralPattern1.js | 8 +- .../reference/declarationsAndAssignments.js | 8 +- ...ngObjectBindingPatternAndAssignment1ES5.js | 12 +- ...uringObjectBindingPatternAndAssignment3.js | 10 +- .../destructuringVariableDeclaration1ES5.js | 10 +- ...ucturingVariableDeclaration1ES5iterable.js | 10 +- .../destructuringVariableDeclaration2.js | 2 +- .../reference/downlevelLetConst12.js | 4 +- .../reference/downlevelLetConst13.js | 8 +- .../reference/downlevelLetConst14.js | 8 +- .../reference/downlevelLetConst15.js | 8 +- .../reference/downlevelLetConst16.js | 28 +- ...jectLiteralExpressionInArrowFunctionES5.js | 4 +- ...jectLiteralExpressionInArrowFunctionES6.js | 4 +- .../emitArrowFunctionWhenUsingArguments17.js | 2 +- .../emitArrowFunctionWhenUsingArguments18.js | 2 +- .../initializePropertiesWithRenamedLet.js | 8 +- .../baselines/reference/letInNonStrictMode.js | 2 +- .../literalTypesAndTypeAssertions.js | 8 +- .../reference/missingAndExcessProperties.js | 8 +- ...oImplicitAnyDestructuringVarDeclaration.js | 2 +- ...ImplicitAnyDestructuringVarDeclaration2.js | 2 +- ...bjectBindingPatternKeywordIdentifiers01.js | 2 +- ...bjectBindingPatternKeywordIdentifiers03.js | 2 +- ...bjectBindingPatternKeywordIdentifiers05.js | 2 +- ...bjectBindingPatternKeywordIdentifiers06.js | 2 +- .../shadowingViaLocalValueOrBindingElement.js | 8 +- ...thandPropertyAssignmentsInDestructuring.js | 16 +- ...ionDestructuringForObjectBindingPattern.js | 4 +- ...estructuringForObjectBindingPattern.js.map | 2 +- ...uringForObjectBindingPattern.sourcemap.txt | 200 +++++++------- ...ingForObjectBindingPatternDefaultValues.js | 4 +- ...orObjectBindingPatternDefaultValues.js.map | 2 +- ...tBindingPatternDefaultValues.sourcemap.txt | 258 +++++++++--------- ...gVariableStatementObjectBindingPattern1.js | 2 +- ...iableStatementObjectBindingPattern1.js.map | 2 +- ...atementObjectBindingPattern1.sourcemap.txt | 14 +- ...gVariableStatementObjectBindingPattern2.js | 2 +- ...iableStatementObjectBindingPattern2.js.map | 2 +- ...atementObjectBindingPattern2.sourcemap.txt | 14 +- ...gVariableStatementObjectBindingPattern3.js | 2 +- ...iableStatementObjectBindingPattern3.js.map | 2 +- ...atementObjectBindingPattern3.sourcemap.txt | 26 +- .../strictModeReservedWordInDestructuring.js | 2 +- .../strictModeUseContextualKeyword.js | 2 +- .../templateStringInObjectLiteral.js | 4 +- .../templateStringInPropertyName1.js | 2 +- .../templateStringInPropertyName2.js | 2 +- 57 files changed, 399 insertions(+), 399 deletions(-) diff --git a/tests/baselines/reference/assignmentTypeNarrowing.js b/tests/baselines/reference/assignmentTypeNarrowing.js index 7c85e7dccf6..92fd49d9941 100644 --- a/tests/baselines/reference/assignmentTypeNarrowing.js +++ b/tests/baselines/reference/assignmentTypeNarrowing.js @@ -37,13 +37,13 @@ x = [true][0]; x; // boolean _a = [1][0], x = _a === void 0 ? "" : _a; x; // string | number -(x = ({ x: true }).x); +(x = { x: true }.x); x; // boolean -(x = ({ y: 1 }).y); +(x = { y: 1 }.y); x; // number -(_b = ({ x: true }).x, x = _b === void 0 ? "" : _b); +(_b = { x: true }.x, x = _b === void 0 ? "" : _b); x; // string | boolean -(_c = ({ y: 1 }).y, x = _c === void 0 ? /a/ : _c); +(_c = { y: 1 }.y, x = _c === void 0 ? /a/ : _c); x; // number | RegExp var a; for (var _i = 0, a_1 = a; _i < a_1.length; _i++) { diff --git a/tests/baselines/reference/asyncMethodWithSuper_es5.js b/tests/baselines/reference/asyncMethodWithSuper_es5.js index 0dbeedabe52..a2931b9f8e1 100644 --- a/tests/baselines/reference/asyncMethodWithSuper_es5.js +++ b/tests/baselines/reference/asyncMethodWithSuper_es5.js @@ -95,9 +95,9 @@ var B = /** @class */ (function (_super) { // element access (assign) _super.prototype["x"] = f; // destructuring assign with property access - (_super.prototype.x = ({ f: f }).f); + (_super.prototype.x = { f: f }.f); // destructuring assign with element access - (_super.prototype["x"] = ({ f: f }).f); + (_super.prototype["x"] = { f: f }.f); return [2 /*return*/]; }); }); diff --git a/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js b/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js index 78fd3dfc92a..cc9ad56be88 100644 --- a/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js +++ b/tests/baselines/reference/blockScopedBindingUsedBeforeDef.js @@ -15,7 +15,7 @@ for (var _i = 0, _a = [{}]; _i < _a.length; _i++) { continue; } // 2: -for (var _c = a, a = ({})[_c]; false;) +for (var _c = a, a = {}[_c]; false;) continue; // 3: -var _d = b, b = ({})[_d]; +var _d = b, b = {}[_d]; diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1.js b/tests/baselines/reference/computedPropertiesInDestructuring1.js index 39d411fb851..e4f15e6b8bf 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1.js +++ b/tests/baselines/reference/computedPropertiesInDestructuring1.js @@ -40,10 +40,10 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; //// [computedPropertiesInDestructuring1.js] // destructuring in variable declarations var foo = "bar"; -var _a = foo, bar = ({ bar: "bar" })[_a]; -var bar2 = ({ bar: "bar" })["bar"]; +var _a = foo, bar = { bar: "bar" }[_a]; +var bar2 = { bar: "bar" }["bar"]; var foo2 = function () { return "bar"; }; -var _b = foo2(), bar3 = ({ bar: "bar" })[_b]; +var _b = foo2(), bar3 = { bar: "bar" }[_b]; var _c = foo, bar4 = [{ bar: "bar" }][0][_c]; var _d = foo2(), bar5 = [{ bar: "bar" }][0][_d]; function f1(_a) { @@ -65,9 +65,9 @@ function f5(_a) { var _e = foo(), bar6 = [{ bar: "bar" }][0][_e]; var _f = foo.toExponential(), bar7 = [{ bar: "bar" }][0][_f]; // destructuring assignment -(_g = foo, bar = ({ bar: "bar" })[_g]); -(bar2 = ({ bar: "bar" })["bar"]); -(_h = foo2(), bar3 = ({ bar: "bar" })[_h]); +(_g = foo, bar = { bar: "bar" }[_g]); +(bar2 = { bar: "bar" }["bar"]); +(_h = foo2(), bar3 = { bar: "bar" }[_h]); _j = foo, bar4 = [{ bar: "bar" }][0][_j]; _k = foo2(), bar5 = [{ bar: "bar" }][0][_k]; _l = foo(), bar4 = [{ bar: "bar" }][0][_l]; diff --git a/tests/baselines/reference/computedPropertiesInDestructuring2.js b/tests/baselines/reference/computedPropertiesInDestructuring2.js index 872cf7831c7..8579881b775 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring2.js +++ b/tests/baselines/reference/computedPropertiesInDestructuring2.js @@ -4,4 +4,4 @@ let {[foo2()]: bar3} = {}; //// [computedPropertiesInDestructuring2.js] var foo2 = function () { return "bar"; }; -var _a = foo2(), bar3 = ({})[_a]; +var _a = foo2(), bar3 = {}[_a]; diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializer.js b/tests/baselines/reference/contextuallyTypedBindingInitializer.js index 3b4956cb336..6542e747edc 100644 --- a/tests/baselines/reference/contextuallyTypedBindingInitializer.js +++ b/tests/baselines/reference/contextuallyTypedBindingInitializer.js @@ -48,4 +48,4 @@ function g(_a) { function h(_a) { var _b = _a.prop, prop = _b === void 0 ? "foo" : _b; } -var _a = ({ stringIdentity: function (x) { return x; } }).stringIdentity, id = _a === void 0 ? function (arg) { return arg; } : _a; +var _a = { stringIdentity: function (x) { return x; } }.stringIdentity, id = _a === void 0 ? function (arg) { return arg; } : _a; diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js index a2d7ba8b1aa..bdc7ed68b3f 100644 --- a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js +++ b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.js @@ -40,7 +40,7 @@ function f3(_a) { function ff(_a) { var _b = _a.nested, nestedRename = _b === void 0 ? { show: function (v) { return v; } } : _b; } -var _a = ({ stringIdentity: function (x) { return x; } }).stringIdentity, id = _a === void 0 ? function (arg) { return arg.length; } : _a; +var _a = { stringIdentity: function (x) { return x; } }.stringIdentity, id = _a === void 0 ? function (arg) { return arg.length; } : _a; function g(_a) { var _b = _a.prop, prop = _b === void 0 ? [101, 1234] : _b; } diff --git a/tests/baselines/reference/controlFlowDestructuringDeclaration.js b/tests/baselines/reference/controlFlowDestructuringDeclaration.js index a26899849be..39192f1baad 100644 --- a/tests/baselines/reference/controlFlowDestructuringDeclaration.js +++ b/tests/baselines/reference/controlFlowDestructuringDeclaration.js @@ -82,27 +82,27 @@ function f3() { z; } function f4() { - var x = ({ x: 1 }).x; + var x = { x: 1 }.x; x; - var y = ({ y: "" }).y; + var y = { y: "" }.y; y; - var _a = ({ z: undefined }).z, z = _a === void 0 ? "" : _a; + var _a = { z: undefined }.z, z = _a === void 0 ? "" : _a; z; } function f5() { - var x = ({ x: 1 }).x; + var x = { x: 1 }.x; x; - var y = ({ y: "" }).y; + var y = { y: "" }.y; y; - var _a = ({ z: undefined }).z, z = _a === void 0 ? "" : _a; + var _a = { z: undefined }.z, z = _a === void 0 ? "" : _a; z; } function f6() { - var x = ({}).x; + var x = {}.x; x; - var y = ({}).y; + var y = {}.y; y; - var _a = ({}).z, z = _a === void 0 ? "" : _a; + var _a = {}.z, z = _a === void 0 ? "" : _a; z; } function f7() { diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js index ef82e607758..0414017b776 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern.js @@ -23,11 +23,11 @@ module m { //// [declarationEmitDestructuringObjectLiteralPattern.js] var _a = { x: 5, y: "hello" }; -var x4 = ({ x4: 5, y4: "hello" }).x4; -var y5 = ({ x5: 5, y5: "hello" }).y5; +var x4 = { x4: 5, y4: "hello" }.x4; +var y5 = { x5: 5, y5: "hello" }.y5; var _b = { x6: 5, y6: "hello" }, x6 = _b.x6, y6 = _b.y6; -var a1 = ({ x7: 5, y7: "hello" }).x7; -var b1 = ({ x8: 5, y8: "hello" }).y8; +var a1 = { x7: 5, y7: "hello" }.x7; +var b1 = { x8: 5, y8: "hello" }.y8; var _c = { x9: 5, y9: "hello" }, a2 = _c.x9, b2 = _c.y9; var _d = { a: 1, b: { a: "hello", b: { a: true } } }, x11 = _d.a, _e = _d.b, y11 = _e.a, z11 = _e.b.a; function f15() { diff --git a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js index 974dc8cc24d..1e8279597d5 100644 --- a/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js +++ b/tests/baselines/reference/declarationEmitDestructuringObjectLiteralPattern1.js @@ -9,11 +9,11 @@ var { x9: a2, y9: b2 } = { x9: 5, y9: "hello" }; //// [declarationEmitDestructuringObjectLiteralPattern1.js] var _a = { x: 5, y: "hello" }; -var x4 = ({ x4: 5, y4: "hello" }).x4; -var y5 = ({ x5: 5, y5: "hello" }).y5; +var x4 = { x4: 5, y4: "hello" }.x4; +var y5 = { x5: 5, y5: "hello" }.y5; var _b = { x6: 5, y6: "hello" }, x6 = _b.x6, y6 = _b.y6; -var a1 = ({ x7: 5, y7: "hello" }).x7; -var b1 = ({ x8: 5, y8: "hello" }).y8; +var a1 = { x7: 5, y7: "hello" }.x7; +var b1 = { x8: 5, y8: "hello" }.y8; var _c = { x9: 5, y9: "hello" }, a2 = _c.x9, b2 = _c.y9; diff --git a/tests/baselines/reference/declarationsAndAssignments.js b/tests/baselines/reference/declarationsAndAssignments.js index d338b454b8b..3a2f9ef3b4e 100644 --- a/tests/baselines/reference/declarationsAndAssignments.js +++ b/tests/baselines/reference/declarationsAndAssignments.js @@ -201,13 +201,13 @@ function f1() { } function f2() { var _a = { x: 5, y: "hello" }; // Error, no x and y in target - var x = ({ x: 5, y: "hello" }).x; // Error, no y in target - var y = ({ x: 5, y: "hello" }).y; // Error, no x in target + var x = { x: 5, y: "hello" }.x; // Error, no y in target + var y = { x: 5, y: "hello" }.y; // Error, no x in target var _b = { x: 5, y: "hello" }, x = _b.x, y = _b.y; var x; var y; - var a = ({ x: 5, y: "hello" }).x; // Error, no y in target - var b = ({ x: 5, y: "hello" }).y; // Error, no x in target + var a = { x: 5, y: "hello" }.x; // Error, no y in target + var b = { x: 5, y: "hello" }.y; // Error, no x in target var _c = { x: 5, y: "hello" }, a = _c.x, b = _c.y; var a; var b; diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js index dee603bd47f..f201b17deda 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.js @@ -60,15 +60,15 @@ var {"prop2": d1} = foo1(); // V is an object assignment pattern and, for each assignment property P in V, // S is the type Any, or var a1 = undefined.a1; -var a2 = ({}).a2; +var a2 = {}.a2; // V is an object assignment pattern and, for each assignment property P in V, // S has an apparent property with the property name specified in // P of a type that is assignable to the target given in P, or -var b1 = ({ b1: 1 }).b1; -var _a = ({ b2: { b21: "world" } }).b2, b21 = (_a === void 0 ? { b21: "string" } : _a).b21; -var b3 = ({ 1: "string" })[1]; -var _b = ({ b4: 100000 }).b4, b4 = _b === void 0 ? 1 : _b; -var b52 = ({ b5: { b52: b52 } }).b5.b52; +var b1 = { b1: 1 }.b1; +var _a = { b2: { b21: "world" } }.b2, b21 = (_a === void 0 ? { b21: "string" } : _a).b21; +var b3 = { 1: "string" }[1]; +var _b = { b4: 100000 }.b4, b4 = _b === void 0 ? 1 : _b; +var b52 = { b5: { b52: b52 } }.b5.b52; function foo() { return { 1: true diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.js b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.js index bec23431d98..0872a71c73b 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.js +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment3.js @@ -10,9 +10,9 @@ var {"prop"} = { "prop": 1 }; //// [destructuringObjectBindingPatternAndAssignment3.js] // Error -var h = ({ h: 1 }).h; -var i = ({ i: 2 }).i; -var i1 = ({ i1: 2 }).i1; +var h = { h: 1 }.h; +var i = { i: 2 }.i; +var i1 = { i1: 2 }.i1; var _a = undefined.f2, f21 = (_a === void 0 ? { f212: "string" } : _a).f21; -var = ({ 1: })[1]; -var = ({ "prop": 1 })["prop"]; +var = { 1: }[1]; +var = { "prop": 1 }["prop"]; diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.js b/tests/baselines/reference/destructuringVariableDeclaration1ES5.js index d627a87a986..6d731538d18 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5.js +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.js @@ -48,7 +48,7 @@ var _a = { a1: 10, a2: "world" }, a1 = _a.a1, a2 = _a.a2; var _b = [1, [["hello"]], true], a3 = _b[0], a4 = _b[1][0][0], a5 = _b[2]; // The type T associated with a destructuring variable declaration is determined as follows: // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. -var _c = ({ b1: { b11: "world" } }).b1, b11 = (_c === void 0 ? { b11: "string" } : _c).b11; +var _c = { b1: { b11: "world" } }.b1, b11 = (_c === void 0 ? { b11: "string" } : _c).b11; var temp = { t1: true, t2: "false" }; var _d = [3, false, { t1: false, t2: "hello" }], _e = _d[0], b2 = _e === void 0 ? 3 : _e, _f = _d[1], b3 = _f === void 0 ? true : _f, _g = _d[2], b4 = _g === void 0 ? temp : _g; var _h = [undefined, undefined, undefined], _j = _h[0], b5 = _j === void 0 ? 3 : _j, _k = _h[1], b6 = _k === void 0 ? true : _k, _l = _h[2], b7 = _l === void 0 ? temp : _l; @@ -68,10 +68,10 @@ var _m = [1, "string"], d1 = _m[0], d2 = _m[1]; var temp1 = [true, false, true]; var _o = [1, "string"].concat(temp1), d3 = _o[0], d4 = _o[1]; // Combining both forms of destructuring, -var _p = ({ e: [1, 2, { b1: 4, b4: 0 }] }).e, e1 = _p[0], e2 = _p[1], _q = _p[2], e3 = _q === void 0 ? { b1: 1000, b4: 200 } : _q; -var _r = ({ f: [1, 2, { f3: 4, f5: 0 }] }).f, f1 = _r[0], f2 = _r[1], _s = _r[2], f4 = _s.f3, f5 = _s.f5; +var _p = { e: [1, 2, { b1: 4, b4: 0 }] }.e, e1 = _p[0], e2 = _p[1], _q = _p[2], e3 = _q === void 0 ? { b1: 1000, b4: 200 } : _q; +var _r = { f: [1, 2, { f3: 4, f5: 0 }] }.f, f1 = _r[0], f2 = _r[1], _s = _r[2], f4 = _s.f3, f5 = _s.f5; // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable // to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. -var _t = ({ g: { g1: [1, 2] } }).g.g1, g1 = _t === void 0 ? [undefined, null] : _t; -var _u = ({ h: { h1: [1, 2] } }).h.h1, h1 = _u === void 0 ? [undefined, null] : _u; +var _t = { g: { g1: [1, 2] } }.g.g1, g1 = _t === void 0 ? [undefined, null] : _t; +var _u = { h: { h1: [1, 2] } }.h.h1, h1 = _u === void 0 ? [undefined, null] : _u; diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.js b/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.js index b59c7e1249b..83fb3de04fc 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.js +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.js @@ -68,7 +68,7 @@ var _a = { a1: 10, a2: "world" }, a1 = _a.a1, a2 = _a.a2; var _b = __read([1, [["hello"]], true], 3), a3 = _b[0], _c = __read(_b[1], 1), _d = __read(_c[0], 1), a4 = _d[0], a5 = _b[2]; // The type T associated with a destructuring variable declaration is determined as follows: // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. -var _e = ({ b1: { b11: "world" } }).b1, b11 = (_e === void 0 ? { b11: "string" } : _e).b11; +var _e = { b1: { b11: "world" } }.b1, b11 = (_e === void 0 ? { b11: "string" } : _e).b11; var temp = { t1: true, t2: "false" }; var _f = __read([3, false, { t1: false, t2: "hello" }], 3), _g = _f[0], b2 = _g === void 0 ? 3 : _g, _h = _f[1], b3 = _h === void 0 ? true : _h, _j = _f[2], b4 = _j === void 0 ? temp : _j; var _k = __read([undefined, undefined, undefined], 3), _l = _k[0], b5 = _l === void 0 ? 3 : _l, _m = _k[1], b6 = _m === void 0 ? true : _m, _o = _k[2], b7 = _o === void 0 ? temp : _o; @@ -88,10 +88,10 @@ var _r = __read([1, "string"], 2), d1 = _r[0], d2 = _r[1]; var temp1 = [true, false, true]; var _s = __read(__spread([1, "string"], temp1), 2), d3 = _s[0], d4 = _s[1]; // Combining both forms of destructuring, -var _t = __read(({ e: [1, 2, { b1: 4, b4: 0 }] }).e, 3), e1 = _t[0], e2 = _t[1], _u = _t[2], e3 = _u === void 0 ? { b1: 1000, b4: 200 } : _u; -var _v = __read(({ f: [1, 2, { f3: 4, f5: 0 }] }).f, 4), f1 = _v[0], f2 = _v[1], _w = _v[2], f4 = _w.f3, f5 = _w.f5; +var _t = __read({ e: [1, 2, { b1: 4, b4: 0 }] }.e, 3), e1 = _t[0], e2 = _t[1], _u = _t[2], e3 = _u === void 0 ? { b1: 1000, b4: 200 } : _u; +var _v = __read({ f: [1, 2, { f3: 4, f5: 0 }] }.f, 4), f1 = _v[0], f2 = _v[1], _w = _v[2], f4 = _w.f3, f5 = _w.f5; // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable // to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. -var _x = ({ g: { g1: [1, 2] } }).g.g1, g1 = _x === void 0 ? [undefined, null] : _x; -var _y = ({ h: { h1: [1, 2] } }).h.h1, h1 = _y === void 0 ? [undefined, null] : _y; +var _x = { g: { g1: [1, 2] } }.g.g1, g1 = _x === void 0 ? [undefined, null] : _x; +var _y = { h: { h1: [1, 2] } }.h.h1, h1 = _y === void 0 ? [undefined, null] : _y; diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.js b/tests/baselines/reference/destructuringVariableDeclaration2.js index b3d4152892a..a4fadd850d7 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration2.js +++ b/tests/baselines/reference/destructuringVariableDeclaration2.js @@ -35,4 +35,4 @@ var _g = [1, 2, { c3: 4, c5: 0 }], c1 = _g[0], c2 = _g[1], _h = _g[2], c4 = _h.c // When a destructuring variable declaration, binding property, or binding element specifies // an initializer expression, the type of the initializer expression is required to be assignable // to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. -var _j = ({ d: { d1: [1, 2] } }).d.d1, d1 = _j === void 0 ? ["string", null] : _j; // Error +var _j = { d: { d1: [1, 2] } }.d.d1, d1 = _j === void 0 ? ["string", null] : _j; // Error diff --git a/tests/baselines/reference/downlevelLetConst12.js b/tests/baselines/reference/downlevelLetConst12.js index 3ab90cee98d..bdc33aaba9d 100644 --- a/tests/baselines/reference/downlevelLetConst12.js +++ b/tests/baselines/reference/downlevelLetConst12.js @@ -16,6 +16,6 @@ const {a: baz4} = { a: 1 }; var foo; var bar = 1; var baz = [][0]; -var baz2 = ({ a: 1 }).a; +var baz2 = { a: 1 }.a; var baz3 = [][0]; -var baz4 = ({ a: 1 }).a; +var baz4 = { a: 1 }.a; diff --git a/tests/baselines/reference/downlevelLetConst13.js b/tests/baselines/reference/downlevelLetConst13.js index 64d169c4013..251468519ad 100644 --- a/tests/baselines/reference/downlevelLetConst13.js +++ b/tests/baselines/reference/downlevelLetConst13.js @@ -26,14 +26,14 @@ exports.foo = 10; exports.bar = "123"; exports.bar1 = [1][0]; exports.bar2 = [2][0]; -exports.bar3 = ({ a: 1 }).a; -exports.bar4 = ({ a: 1 }).a; +exports.bar3 = { a: 1 }.a; +exports.bar4 = { a: 1 }.a; var M; (function (M) { M.baz = 100; M.baz2 = true; M.bar5 = [1][0]; M.bar6 = [2][0]; - M.bar7 = ({ a: 1 }).a; - M.bar8 = ({ a: 1 }).a; + M.bar7 = { a: 1 }.a; + M.bar8 = { a: 1 }.a; })(M = exports.M || (exports.M = {})); diff --git a/tests/baselines/reference/downlevelLetConst14.js b/tests/baselines/reference/downlevelLetConst14.js index 0d671dbaaa7..cddfb967217 100644 --- a/tests/baselines/reference/downlevelLetConst14.js +++ b/tests/baselines/reference/downlevelLetConst14.js @@ -65,9 +65,9 @@ var z0, z1, z2, z3; use(z0_1); var z1_1 = [1][0]; use(z1_1); - var z2_1 = ({ a: 1 }).a; + var z2_1 = { a: 1 }.a; use(z2_1); - var z3_1 = ({ a: 1 }).a; + var z3_1 = { a: 1 }.a; use(z3_1); } use(x); @@ -82,7 +82,7 @@ var y = true; var z6_1 = [true][0]; { var y_2 = 1; - var z6_2 = ({ a: 1 }).a; + var z6_2 = { a: 1 }.a; use(y_2); use(z6_2); } @@ -98,7 +98,7 @@ var z5 = 1; var z5_1 = [5][0]; { var _z = 1; - var _z5 = ({ a: 1 }).a; + var _z5 = { a: 1 }.a; // try to step on generated name use(_z); } diff --git a/tests/baselines/reference/downlevelLetConst15.js b/tests/baselines/reference/downlevelLetConst15.js index bd70cfe767c..807f49bf84e 100644 --- a/tests/baselines/reference/downlevelLetConst15.js +++ b/tests/baselines/reference/downlevelLetConst15.js @@ -65,9 +65,9 @@ var z0, z1, z2, z3; use(z0_1); var z1_1 = [{ a: 1 }][0].a; use(z1_1); - var z2_1 = ({ a: 1 }).a; + var z2_1 = { a: 1 }.a; use(z2_1); - var z3_1 = ({ a: { b: 1 } }).a.b; + var z3_1 = { a: { b: 1 } }.a.b; use(z3_1); } use(x); @@ -82,7 +82,7 @@ var y = true; var z6_1 = [true][0]; { var y_2 = 1; - var z6_2 = ({ a: 1 }).a; + var z6_2 = { a: 1 }.a; use(y_2); use(z6_2); } @@ -98,7 +98,7 @@ var z5 = 1; var z5_1 = [5][0]; { var _z = 1; - var _z5 = ({ a: 1 }).a; + var _z5 = { a: 1 }.a; // try to step on generated name use(_z); } diff --git a/tests/baselines/reference/downlevelLetConst16.js b/tests/baselines/reference/downlevelLetConst16.js index 0231d98fec2..338489b20c3 100644 --- a/tests/baselines/reference/downlevelLetConst16.js +++ b/tests/baselines/reference/downlevelLetConst16.js @@ -240,7 +240,7 @@ function foo1() { use(x); var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); } function foo2() { @@ -249,7 +249,7 @@ function foo2() { use(x_1); var y_1 = [1][0]; use(y_1); - var z_1 = ({ a: 1 }).a; + var z_1 = { a: 1 }.a; use(z_1); } use(x); @@ -262,7 +262,7 @@ var A = /** @class */ (function () { use(x); var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); }; A.prototype.m2 = function () { @@ -271,7 +271,7 @@ var A = /** @class */ (function () { use(x_2); var y_2 = [1][0]; use(y_2); - var z_2 = ({ a: 1 }).a; + var z_2 = { a: 1 }.a; use(z_2); } use(x); @@ -286,7 +286,7 @@ var B = /** @class */ (function () { use(x); var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); }; B.prototype.m2 = function () { @@ -295,7 +295,7 @@ var B = /** @class */ (function () { use(x_3); var y_3 = [1][0]; use(y_3); - var z_3 = ({ a: 1 }).a; + var z_3 = { a: 1 }.a; use(z_3); } use(x); @@ -307,7 +307,7 @@ function bar1() { use(x); var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); } function bar2() { @@ -316,7 +316,7 @@ function bar2() { use(x_4); var y_4 = [1][0]; use(y_4); - var z_4 = ({ a: 1 }).a; + var z_4 = { a: 1 }.a; use(z_4); } use(x); @@ -327,7 +327,7 @@ var M1; use(x); var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); })(M1 || (M1 = {})); var M2; @@ -337,7 +337,7 @@ var M2; use(x_5); var y_5 = [1][0]; use(y_5); - var z_5 = ({ a: 1 }).a; + var z_5 = { a: 1 }.a; use(z_5); } use(x); @@ -348,7 +348,7 @@ var M3; use(x); var y = [1][0]; use(y); - var z = ({ a: 1 }).a; + var z = { a: 1 }.a; use(z); })(M3 || (M3 = {})); var M4; @@ -358,7 +358,7 @@ var M4; use(x_6); var y_6 = [1][0]; use(y_6); - var z_6 = ({ a: 1 }).a; + var z_6 = { a: 1 }.a; use(z_6); } use(x); @@ -372,7 +372,7 @@ function foo3() { for (var y_7 = [][0];;) { use(y_7); } - for (var z_7 = ({ a: 1 }).a;;) { + for (var z_7 = { a: 1 }.a;;) { use(z_7); } use(x); @@ -384,7 +384,7 @@ function foo4() { for (var y_8 = [][0];;) { use(y_8); } - for (var z_8 = ({ a: 1 }).a;;) { + for (var z_8 = { a: 1 }.a;;) { use(z_8); } use(x); diff --git a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.js b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.js index 5d99dad3c0c..182e678b7bf 100644 --- a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.js +++ b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.js @@ -3,5 +3,5 @@ (x) => ({ "1": "one", "2": "two" } as { [key: string]: string }).x; //// [emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.js] -(function (x) { return ({ "1": "one", "2": "two" })[x]; }); -(function (x) { return ({ "1": "one", "2": "two" }).x; }); +(function (x) { return ({ "1": "one", "2": "two" }[x]); }); +(function (x) { return ({ "1": "one", "2": "two" }.x); }); diff --git a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.js b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.js index dc3891a9bd4..8d7999b0da7 100644 --- a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.js +++ b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.js @@ -3,5 +3,5 @@ (x) => ({ "1": "one", "2": "two" } as { [key: string]: string }).x; //// [emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.js] -(x) => ({ "1": "one", "2": "two" })[x]; -(x) => ({ "1": "one", "2": "two" }).x; +(x) => ({ "1": "one", "2": "two" }[x]); +(x) => ({ "1": "one", "2": "two" }.x); diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js index 7572b0c3af1..60044ac5dc4 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17.js @@ -9,7 +9,7 @@ function f() { //// [emitArrowFunctionWhenUsingArguments17.js] function f() { - var arguments = ({ arguments: "hello" }).arguments; + var arguments = { arguments: "hello" }.arguments; if (Math.random()) { return function () { return arguments[0]; }; } diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js index 3af9c580231..a88a01c7a56 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18.js @@ -8,7 +8,7 @@ function f() { //// [emitArrowFunctionWhenUsingArguments18.js] function f() { - var args = ({ arguments: arguments }).arguments; + var args = { arguments: arguments }.arguments; if (Math.random()) { return function () { return arguments; }; } diff --git a/tests/baselines/reference/initializePropertiesWithRenamedLet.js b/tests/baselines/reference/initializePropertiesWithRenamedLet.js index 0ed325b2a31..d6c53b7d525 100644 --- a/tests/baselines/reference/initializePropertiesWithRenamedLet.js +++ b/tests/baselines/reference/initializePropertiesWithRenamedLet.js @@ -24,9 +24,9 @@ if (true) { } var x, y, z; if (true) { - var x_1 = ({ x: 0 }).x; - var y_1 = ({ y: 0 }).y; + var x_1 = { x: 0 }.x; + var y_1 = { y: 0 }.y; var z_1; - (z_1 = ({ z: 0 }).z); - (z_1 = ({ z: 0 }).z); + (z_1 = { z: 0 }.z); + (z_1 = { z: 0 }.z); } diff --git a/tests/baselines/reference/letInNonStrictMode.js b/tests/baselines/reference/letInNonStrictMode.js index 3627a72e7ff..8e4920cc220 100644 --- a/tests/baselines/reference/letInNonStrictMode.js +++ b/tests/baselines/reference/letInNonStrictMode.js @@ -4,4 +4,4 @@ let {a: y} = {a: 1}; //// [letInNonStrictMode.js] var x = [1][0]; -var y = ({ a: 1 }).a; +var y = { a: 1 }.a; diff --git a/tests/baselines/reference/literalTypesAndTypeAssertions.js b/tests/baselines/reference/literalTypesAndTypeAssertions.js index 6c95fd45802..ab6a82852a5 100644 --- a/tests/baselines/reference/literalTypesAndTypeAssertions.js +++ b/tests/baselines/reference/literalTypesAndTypeAssertions.js @@ -22,7 +22,7 @@ var obj = { }; var x1 = 1; var x2 = 1; -var _a = ({ a: "foo" }).a, a = _a === void 0 ? "foo" : _a; -var _b = ({ b: "bar" }).b, b = _b === void 0 ? "foo" : _b; -var _c = ({ c: "bar" }).c, c = _c === void 0 ? "foo" : _c; -var _d = ({ d: "bar" }).d, d = _d === void 0 ? "foo" : _d; +var _a = { a: "foo" }.a, a = _a === void 0 ? "foo" : _a; +var _b = { b: "bar" }.b, b = _b === void 0 ? "foo" : _b; +var _c = { c: "bar" }.c, c = _c === void 0 ? "foo" : _c; +var _d = { d: "bar" }.d, d = _d === void 0 ? "foo" : _d; diff --git a/tests/baselines/reference/missingAndExcessProperties.js b/tests/baselines/reference/missingAndExcessProperties.js index 28e0f13b4bd..daefe18eed7 100644 --- a/tests/baselines/reference/missingAndExcessProperties.js +++ b/tests/baselines/reference/missingAndExcessProperties.js @@ -54,16 +54,16 @@ function f2() { // Excess properties function f3() { var _a = { x: 0, y: 0 }; - var x = ({ x: 0, y: 0 }).x; - var y = ({ x: 0, y: 0 }).y; + var x = { x: 0, y: 0 }.x; + var y = { x: 0, y: 0 }.y; var _b = { x: 0, y: 0 }, x = _b.x, y = _b.y; } // Excess properties function f4() { var x, y; ({ x: 0, y: 0 }); - (x = ({ x: 0, y: 0 }).x); - (y = ({ x: 0, y: 0 }).y); + (x = { x: 0, y: 0 }.x); + (y = { x: 0, y: 0 }.y); (_a = { x: 0, y: 0 }, x = _a.x, y = _a.y); var _a; } diff --git a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.js b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.js index 1dbc933cbf5..85358df666e 100644 --- a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.js +++ b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.js @@ -16,5 +16,5 @@ var a = (void 0)[0], b = (void 0).b, c, d; // error var _a = (void 0)[0], a1 = _a === void 0 ? undefined : _a, _b = (void 0).b1, b1 = _b === void 0 ? null : _b, c1 = undefined, d1 = null; // error var a2 = (void 0)[0], b2 = (void 0).b2, c2, d2; var b3 = (void 0).b3, c3; // error in type instead -var a4 = [undefined][0], b4 = ({ b4: null }).b4, c4 = undefined, d4 = null; // error +var a4 = [undefined][0], b4 = { b4: null }.b4, c4 = undefined, d4 = null; // error var _c = [][0], a5 = _c === void 0 ? undefined : _c; // error diff --git a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.js b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.js index 81d8ba6386f..79ee0b8830f 100644 --- a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.js +++ b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.js @@ -22,4 +22,4 @@ var _p = { x: 1, y: 2, z: 3 }, x = _p.x, y = _p.y, z = _p.z; // no error var _q = { x1: 1, y1: 2, z1: 3 }, _r = _q.x1, x1 = _r === void 0 ? 10 : _r, _s = _q.y1, y1 = _s === void 0 ? 10 : _s, _t = _q.z1, z1 = _t === void 0 ? 10 : _t; // no error var _u = { x2: 1, y2: 2, z2: 3 }, _v = _u.x2, x2 = _v === void 0 ? undefined : _v, _w = _u.y2, y2 = _w === void 0 ? undefined : _w, _x = _u.z2, z2 = _x === void 0 ? undefined : _x; // no error var _y = { x3: 1, y3: 2, z3: 3 }, _z = _y.x3, x3 = _z === void 0 ? undefined : _z, _0 = _y.y3, y3 = _0 === void 0 ? null : _0, _1 = _y.z3, z3 = _1 === void 0 ? undefined : _1; // no error -var x4 = ({ x4: undefined }).x4, y4 = ({ y4: null }).y4; // no error +var x4 = { x4: undefined }.x4, y4 = { y4: null }.y4; // no error diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.js index 2bac381b603..ec0cae158fc 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.js +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers01.js @@ -2,4 +2,4 @@ var { while } = { while: 1 } //// [objectBindingPatternKeywordIdentifiers01.js] -var = ({ "while": 1 })["while"]; +var = { "while": 1 }["while"]; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.js index d1fb037dfbe..6c9a539bb69 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.js +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers03.js @@ -2,4 +2,4 @@ var { "while" } = { while: 1 } //// [objectBindingPatternKeywordIdentifiers03.js] -var = ({ "while": 1 })["while"]; +var = { "while": 1 }["while"]; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.js index 146ac4b2077..08f8e632f29 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.js +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers05.js @@ -2,4 +2,4 @@ var { as } = { as: 1 } //// [objectBindingPatternKeywordIdentifiers05.js] -var as = ({ as: 1 }).as; +var as = { as: 1 }.as; diff --git a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.js b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.js index d465161f4ce..9f29dfff1f8 100644 --- a/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.js +++ b/tests/baselines/reference/objectBindingPatternKeywordIdentifiers06.js @@ -2,4 +2,4 @@ var { as: as } = { as: 1 } //// [objectBindingPatternKeywordIdentifiers06.js] -var as = ({ as: 1 }).as; +var as = { as: 1 }.as; diff --git a/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js index b3c44600d1d..e1cae9c73fe 100644 --- a/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js +++ b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.js @@ -15,9 +15,9 @@ if (true) { var x_1; if (true) { var x = 0; // Error - var _a = ({ x: 0 }).x, x = _a === void 0 ? 0 : _a; // Error - var _b = ({ x: 0 }).x, x = _b === void 0 ? 0 : _b; // Error - var x = ({ x: 0 }).x; // Error - var x = ({ x: 0 }).x; // Error + var _a = { x: 0 }.x, x = _a === void 0 ? 0 : _a; // Error + var _b = { x: 0 }.x, x = _b === void 0 ? 0 : _b; // Error + var x = { x: 0 }.x; // Error + var x = { x: 0 }.x; // Error } } diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js index 7e1c7622cf7..ca874652de8 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.js @@ -174,32 +174,32 @@ function foo({a = 4, b = { x: 5 }}) { }); (function () { var y; - (_a = ({ y: 1 }).y, y = _a === void 0 ? 5 : _a); + (_a = { y: 1 }.y, y = _a === void 0 ? 5 : _a); var _a; }); (function () { var y; - (_a = ({ y: 1 }).y, y = _a === void 0 ? 5 : _a); + (_a = { y: 1 }.y, y = _a === void 0 ? 5 : _a); var _a; }); (function () { var y0; - (_a = ({ y0: 1 }).y0, y0 = _a === void 0 ? 5 : _a); + (_a = { y0: 1 }.y0, y0 = _a === void 0 ? 5 : _a); var _a; }); (function () { var y0; - (_a = ({ y0: 1 }).y0, y0 = _a === void 0 ? 5 : _a); + (_a = { y0: 1 }.y0, y0 = _a === void 0 ? 5 : _a); var _a; }); (function () { var y1; - (_a = ({}).y1, y1 = _a === void 0 ? 5 : _a); + (_a = {}.y1, y1 = _a === void 0 ? 5 : _a); var _a; }); (function () { var y1; - (_a = ({}).y1, y1 = _a === void 0 ? 5 : _a); + (_a = {}.y1, y1 = _a === void 0 ? 5 : _a); var _a; }); (function () { @@ -224,12 +224,12 @@ function foo({a = 4, b = { x: 5 }}) { }); (function () { var z; - (_a = ({ z: { x: 1 } }).z, z = _a === void 0 ? { x: 5 } : _a); + (_a = { z: { x: 1 } }.z, z = _a === void 0 ? { x: 5 } : _a); var _a; }); (function () { var z; - (_a = ({ z: { x: 1 } }).z, z = _a === void 0 ? { x: 5 } : _a); + (_a = { z: { x: 1 } }.z, z = _a === void 0 ? { x: 5 } : _a); var _a; }); (function () { diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js index 46d9e251439..ca29b2eabd8 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js @@ -81,7 +81,7 @@ for (var nameA = robot.name, i = 0; i < 1; i++) { for (var nameA = getRobot().name, i = 0; i < 1; i++) { console.log(nameA); } -for (var nameA = ({ name: "trimmer", skill: "trimming" }).name, i = 0; i < 1; i++) { +for (var nameA = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) { console.log(nameA); } for (var _a = multiRobot.skills, primaryA = _a.primary, secondaryA = _a.secondary, i = 0; i < 1; i++) { @@ -90,7 +90,7 @@ for (var _a = multiRobot.skills, primaryA = _a.primary, secondaryA = _a.secondar for (var _b = getMultiRobot().skills, primaryA = _b.primary, secondaryA = _b.secondary, i = 0; i < 1; i++) { console.log(primaryA); } -for (var _c = ({ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }).skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { +for (var _c = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { console.log(primaryA); } for (var nameA = robot.name, skillA = robot.skill, i = 0; i < 1; i++) { diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map index e0fa0db3b1a..a0295550f0b 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForObjectBindingPattern.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern.ts"],"names":[],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt index 94cab1030c8..5ea0b7e360d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt @@ -396,33 +396,33 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} 1 >Emitted(14, 1) Source(31, 1) + SourceIndex(0) 2 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) --- ->>>for (var nameA = ({ name: "trimmer", skill: "trimming" }).name, i = 0; i < 1; i++) { +>>>for (var nameA = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) { 1-> 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ +19> ^ 1-> > 2 >for @@ -430,38 +430,38 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 4 > (let { 5 > 6 > name: nameA -7 > } = { name: "trimmer", skill: "trimming" }, -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +7 > } = { name: "trimmer", skill: "trimming" }, +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) +19> { 1->Emitted(15, 1) Source(32, 1) + SourceIndex(0) 2 >Emitted(15, 4) Source(32, 4) + SourceIndex(0) 3 >Emitted(15, 5) Source(32, 5) + SourceIndex(0) 4 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) 5 >Emitted(15, 10) Source(32, 11) + SourceIndex(0) -6 >Emitted(15, 63) Source(32, 22) + SourceIndex(0) -7 >Emitted(15, 65) Source(32, 74) + SourceIndex(0) -8 >Emitted(15, 66) Source(32, 75) + SourceIndex(0) -9 >Emitted(15, 69) Source(32, 78) + SourceIndex(0) -10>Emitted(15, 70) Source(32, 79) + SourceIndex(0) -11>Emitted(15, 72) Source(32, 81) + SourceIndex(0) -12>Emitted(15, 73) Source(32, 82) + SourceIndex(0) -13>Emitted(15, 76) Source(32, 85) + SourceIndex(0) -14>Emitted(15, 77) Source(32, 86) + SourceIndex(0) -15>Emitted(15, 79) Source(32, 88) + SourceIndex(0) -16>Emitted(15, 80) Source(32, 89) + SourceIndex(0) -17>Emitted(15, 82) Source(32, 91) + SourceIndex(0) -18>Emitted(15, 84) Source(32, 93) + SourceIndex(0) -19>Emitted(15, 85) Source(32, 94) + SourceIndex(0) +6 >Emitted(15, 61) Source(32, 22) + SourceIndex(0) +7 >Emitted(15, 63) Source(32, 74) + SourceIndex(0) +8 >Emitted(15, 64) Source(32, 75) + SourceIndex(0) +9 >Emitted(15, 67) Source(32, 78) + SourceIndex(0) +10>Emitted(15, 68) Source(32, 79) + SourceIndex(0) +11>Emitted(15, 70) Source(32, 81) + SourceIndex(0) +12>Emitted(15, 71) Source(32, 82) + SourceIndex(0) +13>Emitted(15, 74) Source(32, 85) + SourceIndex(0) +14>Emitted(15, 75) Source(32, 86) + SourceIndex(0) +15>Emitted(15, 77) Source(32, 88) + SourceIndex(0) +16>Emitted(15, 78) Source(32, 89) + SourceIndex(0) +17>Emitted(15, 80) Source(32, 91) + SourceIndex(0) +18>Emitted(15, 82) Source(32, 93) + SourceIndex(0) +19>Emitted(15, 83) Source(32, 94) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -711,37 +711,37 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} 1 >Emitted(23, 1) Source(40, 1) + SourceIndex(0) 2 >Emitted(23, 2) Source(40, 2) + SourceIndex(0) --- ->>>for (var _c = ({ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }).skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { +>>>for (var _c = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { 1-> 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ +23> ^ 1-> > 2 >for @@ -749,48 +749,48 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 4 > (let { 5 > 6 > skills: { primary: primaryA, secondary: secondaryA } -7 > -8 > primary: primaryA -9 > , -10> secondary: secondaryA -11> } } = - > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, - > -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +11> } } = + > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) +23> { 1->Emitted(24, 1) Source(41, 1) + SourceIndex(0) 2 >Emitted(24, 4) Source(41, 4) + SourceIndex(0) 3 >Emitted(24, 5) Source(41, 5) + SourceIndex(0) 4 >Emitted(24, 6) Source(41, 12) + SourceIndex(0) 5 >Emitted(24, 10) Source(41, 12) + SourceIndex(0) -6 >Emitted(24, 97) Source(41, 64) + SourceIndex(0) -7 >Emitted(24, 99) Source(41, 22) + SourceIndex(0) -8 >Emitted(24, 120) Source(41, 39) + SourceIndex(0) -9 >Emitted(24, 122) Source(41, 41) + SourceIndex(0) -10>Emitted(24, 147) Source(41, 62) + SourceIndex(0) -11>Emitted(24, 149) Source(43, 5) + SourceIndex(0) -12>Emitted(24, 150) Source(43, 6) + SourceIndex(0) -13>Emitted(24, 153) Source(43, 9) + SourceIndex(0) -14>Emitted(24, 154) Source(43, 10) + SourceIndex(0) -15>Emitted(24, 156) Source(43, 12) + SourceIndex(0) -16>Emitted(24, 157) Source(43, 13) + SourceIndex(0) -17>Emitted(24, 160) Source(43, 16) + SourceIndex(0) -18>Emitted(24, 161) Source(43, 17) + SourceIndex(0) -19>Emitted(24, 163) Source(43, 19) + SourceIndex(0) -20>Emitted(24, 164) Source(43, 20) + SourceIndex(0) -21>Emitted(24, 166) Source(43, 22) + SourceIndex(0) -22>Emitted(24, 168) Source(43, 24) + SourceIndex(0) -23>Emitted(24, 169) Source(43, 25) + SourceIndex(0) +6 >Emitted(24, 95) Source(41, 64) + SourceIndex(0) +7 >Emitted(24, 97) Source(41, 22) + SourceIndex(0) +8 >Emitted(24, 118) Source(41, 39) + SourceIndex(0) +9 >Emitted(24, 120) Source(41, 41) + SourceIndex(0) +10>Emitted(24, 145) Source(41, 62) + SourceIndex(0) +11>Emitted(24, 147) Source(43, 5) + SourceIndex(0) +12>Emitted(24, 148) Source(43, 6) + SourceIndex(0) +13>Emitted(24, 151) Source(43, 9) + SourceIndex(0) +14>Emitted(24, 152) Source(43, 10) + SourceIndex(0) +15>Emitted(24, 154) Source(43, 12) + SourceIndex(0) +16>Emitted(24, 155) Source(43, 13) + SourceIndex(0) +17>Emitted(24, 158) Source(43, 16) + SourceIndex(0) +18>Emitted(24, 159) Source(43, 17) + SourceIndex(0) +19>Emitted(24, 161) Source(43, 19) + SourceIndex(0) +20>Emitted(24, 162) Source(43, 20) + SourceIndex(0) +21>Emitted(24, 164) Source(43, 22) + SourceIndex(0) +22>Emitted(24, 166) Source(43, 24) + SourceIndex(0) +23>Emitted(24, 167) Source(43, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js index 3a3ffc6b8d4..785148ba652 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js @@ -112,7 +112,7 @@ for (var _a = robot.name, nameA = _a === void 0 ? "noName" : _a, i = 0; i < 1; i for (var _b = getRobot().name, nameA = _b === void 0 ? "noName" : _b, i = 0; i < 1; i++) { console.log(nameA); } -for (var _c = ({ name: "trimmer", skill: "trimming" }).name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { +for (var _c = { name: "trimmer", skill: "trimming" }.name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { console.log(nameA); } for (var _d = multiRobot.skills, _e = _d === void 0 ? { primary: "none", secondary: "none" } : _d, _f = _e.primary, primaryA = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryA = _g === void 0 ? "secondary" : _g, i = 0; i < 1; i++) { @@ -121,7 +121,7 @@ for (var _d = multiRobot.skills, _e = _d === void 0 ? { primary: "none", seconda for (var _h = getMultiRobot().skills, _j = _h === void 0 ? { primary: "none", secondary: "none" } : _h, _k = _j.primary, primaryA = _k === void 0 ? "primary" : _k, _l = _j.secondary, secondaryA = _l === void 0 ? "secondary" : _l, i = 0; i < 1; i++) { console.log(primaryA); } -for (var _m = ({ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }).skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { +for (var _m = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { console.log(primaryA); } for (var _r = robot.name, nameA = _r === void 0 ? "noName" : _r, _s = robot.skill, skillA = _s === void 0 ? "skill" : _s, i = 0; i < 1; i++) { diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map index ac5719ded6a..0e96b80e749 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt index 61eeccd186f..ebe3dccdad7 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt @@ -408,35 +408,35 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} 1 >Emitted(14, 1) Source(31, 1) + SourceIndex(0) 2 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) --- ->>>for (var _c = ({ name: "trimmer", skill: "trimming" }).name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { +>>>for (var _c = { name: "trimmer", skill: "trimming" }.name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { 1-> 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ +21> ^ 1-> > 2 >for @@ -444,42 +444,42 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 4 > (let { 5 > 6 > name: nameA = "noName" -7 > -8 > name: nameA = "noName" -9 > } = { name: "trimmer", skill: "trimming" }, -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +7 > +8 > name: nameA = "noName" +9 > } = { name: "trimmer", skill: "trimming" }, +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) +21> { 1->Emitted(15, 1) Source(32, 1) + SourceIndex(0) 2 >Emitted(15, 4) Source(32, 4) + SourceIndex(0) 3 >Emitted(15, 5) Source(32, 5) + SourceIndex(0) 4 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) 5 >Emitted(15, 10) Source(32, 11) + SourceIndex(0) -6 >Emitted(15, 60) Source(32, 33) + SourceIndex(0) -7 >Emitted(15, 62) Source(32, 11) + SourceIndex(0) -8 >Emitted(15, 99) Source(32, 33) + SourceIndex(0) -9 >Emitted(15, 101) Source(32, 85) + SourceIndex(0) -10>Emitted(15, 102) Source(32, 86) + SourceIndex(0) -11>Emitted(15, 105) Source(32, 89) + SourceIndex(0) -12>Emitted(15, 106) Source(32, 90) + SourceIndex(0) -13>Emitted(15, 108) Source(32, 92) + SourceIndex(0) -14>Emitted(15, 109) Source(32, 93) + SourceIndex(0) -15>Emitted(15, 112) Source(32, 96) + SourceIndex(0) -16>Emitted(15, 113) Source(32, 97) + SourceIndex(0) -17>Emitted(15, 115) Source(32, 99) + SourceIndex(0) -18>Emitted(15, 116) Source(32, 100) + SourceIndex(0) -19>Emitted(15, 118) Source(32, 102) + SourceIndex(0) -20>Emitted(15, 120) Source(32, 104) + SourceIndex(0) -21>Emitted(15, 121) Source(32, 105) + SourceIndex(0) +6 >Emitted(15, 58) Source(32, 33) + SourceIndex(0) +7 >Emitted(15, 60) Source(32, 11) + SourceIndex(0) +8 >Emitted(15, 97) Source(32, 33) + SourceIndex(0) +9 >Emitted(15, 99) Source(32, 85) + SourceIndex(0) +10>Emitted(15, 100) Source(32, 86) + SourceIndex(0) +11>Emitted(15, 103) Source(32, 89) + SourceIndex(0) +12>Emitted(15, 104) Source(32, 90) + SourceIndex(0) +13>Emitted(15, 106) Source(32, 92) + SourceIndex(0) +14>Emitted(15, 107) Source(32, 93) + SourceIndex(0) +15>Emitted(15, 110) Source(32, 96) + SourceIndex(0) +16>Emitted(15, 111) Source(32, 97) + SourceIndex(0) +17>Emitted(15, 113) Source(32, 99) + SourceIndex(0) +18>Emitted(15, 114) Source(32, 100) + SourceIndex(0) +19>Emitted(15, 116) Source(32, 102) + SourceIndex(0) +20>Emitted(15, 118) Source(32, 104) + SourceIndex(0) +21>Emitted(15, 119) Source(32, 105) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -785,43 +785,43 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. >>>} 1 > 2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > 2 >} 1 >Emitted(23, 1) Source(50, 1) + SourceIndex(0) 2 >Emitted(23, 2) Source(50, 2) + SourceIndex(0) --- ->>>for (var _m = ({ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }).skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { +>>>for (var _m = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { 1-> 2 >^^^ 3 > ^ 4 > ^ 5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^^ -24> ^ -25> ^^ -26> ^ -27> ^^ -28> ^^ -29> ^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^^ +24> ^ +25> ^^ +26> ^ +27> ^^ +28> ^^ +29> ^ 1-> > 2 >for @@ -833,65 +833,65 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -7 > -8 > skills: { - > primary: primaryA = "primary", - > secondary: secondaryA = "secondary" - > } = { primary: "none", secondary: "none" } -9 > -10> primary: primaryA = "primary" -11> -12> primary: primaryA = "primary" -13> , - > -14> secondary: secondaryA = "secondary" -15> -16> secondary: secondaryA = "secondary" -17> - > } = { primary: "none", secondary: "none" } - > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, - > -18> i -19> = -20> 0 -21> ; -22> i -23> < -24> 1 -25> ; -26> i -27> ++ -28> ) -29> { +7 > +8 > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "none", secondary: "none" } +9 > +10> primary: primaryA = "primary" +11> +12> primary: primaryA = "primary" +13> , + > +14> secondary: secondaryA = "secondary" +15> +16> secondary: secondaryA = "secondary" +17> + > } = { primary: "none", secondary: "none" } + > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, + > +18> i +19> = +20> 0 +21> ; +22> i +23> < +24> 1 +25> ; +26> i +27> ++ +28> ) +29> { 1->Emitted(24, 1) Source(51, 1) + SourceIndex(0) 2 >Emitted(24, 4) Source(51, 4) + SourceIndex(0) 3 >Emitted(24, 5) Source(51, 5) + SourceIndex(0) 4 >Emitted(24, 6) Source(52, 5) + SourceIndex(0) 5 >Emitted(24, 10) Source(52, 5) + SourceIndex(0) -6 >Emitted(24, 97) Source(55, 47) + SourceIndex(0) -7 >Emitted(24, 99) Source(52, 5) + SourceIndex(0) -8 >Emitted(24, 163) Source(55, 47) + SourceIndex(0) -9 >Emitted(24, 165) Source(53, 9) + SourceIndex(0) -10>Emitted(24, 180) Source(53, 38) + SourceIndex(0) -11>Emitted(24, 182) Source(53, 9) + SourceIndex(0) -12>Emitted(24, 223) Source(53, 38) + SourceIndex(0) -13>Emitted(24, 225) Source(54, 9) + SourceIndex(0) -14>Emitted(24, 242) Source(54, 44) + SourceIndex(0) -15>Emitted(24, 244) Source(54, 9) + SourceIndex(0) -16>Emitted(24, 289) Source(54, 44) + SourceIndex(0) -17>Emitted(24, 291) Source(57, 5) + SourceIndex(0) -18>Emitted(24, 292) Source(57, 6) + SourceIndex(0) -19>Emitted(24, 295) Source(57, 9) + SourceIndex(0) -20>Emitted(24, 296) Source(57, 10) + SourceIndex(0) -21>Emitted(24, 298) Source(57, 12) + SourceIndex(0) -22>Emitted(24, 299) Source(57, 13) + SourceIndex(0) -23>Emitted(24, 302) Source(57, 16) + SourceIndex(0) -24>Emitted(24, 303) Source(57, 17) + SourceIndex(0) -25>Emitted(24, 305) Source(57, 19) + SourceIndex(0) -26>Emitted(24, 306) Source(57, 20) + SourceIndex(0) -27>Emitted(24, 308) Source(57, 22) + SourceIndex(0) -28>Emitted(24, 310) Source(57, 24) + SourceIndex(0) -29>Emitted(24, 311) Source(57, 25) + SourceIndex(0) +6 >Emitted(24, 95) Source(55, 47) + SourceIndex(0) +7 >Emitted(24, 97) Source(52, 5) + SourceIndex(0) +8 >Emitted(24, 161) Source(55, 47) + SourceIndex(0) +9 >Emitted(24, 163) Source(53, 9) + SourceIndex(0) +10>Emitted(24, 178) Source(53, 38) + SourceIndex(0) +11>Emitted(24, 180) Source(53, 9) + SourceIndex(0) +12>Emitted(24, 221) Source(53, 38) + SourceIndex(0) +13>Emitted(24, 223) Source(54, 9) + SourceIndex(0) +14>Emitted(24, 240) Source(54, 44) + SourceIndex(0) +15>Emitted(24, 242) Source(54, 9) + SourceIndex(0) +16>Emitted(24, 287) Source(54, 44) + SourceIndex(0) +17>Emitted(24, 289) Source(57, 5) + SourceIndex(0) +18>Emitted(24, 290) Source(57, 6) + SourceIndex(0) +19>Emitted(24, 293) Source(57, 9) + SourceIndex(0) +20>Emitted(24, 294) Source(57, 10) + SourceIndex(0) +21>Emitted(24, 296) Source(57, 12) + SourceIndex(0) +22>Emitted(24, 297) Source(57, 13) + SourceIndex(0) +23>Emitted(24, 300) Source(57, 16) + SourceIndex(0) +24>Emitted(24, 301) Source(57, 17) + SourceIndex(0) +25>Emitted(24, 303) Source(57, 19) + SourceIndex(0) +26>Emitted(24, 304) Source(57, 20) + SourceIndex(0) +27>Emitted(24, 306) Source(57, 22) + SourceIndex(0) +28>Emitted(24, 308) Source(57, 24) + SourceIndex(0) +29>Emitted(24, 309) Source(57, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js index 164159655b2..a20e7578d93 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js @@ -2,5 +2,5 @@ var {x} = { x: 20 }; //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js] -var x = ({ x: 20 }).x; +var x = { x: 20 }.x; //# sourceMappingURL=sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map index b1104fa4eab..b0a552391c9 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.ts"],"names":[],"mappings":"AAAK,IAAA,iBAAC,CAAc"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.ts"],"names":[],"mappings":"AAAK,IAAA,eAAC,CAAc"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.sourcemap.txt index fb41dc6233f..0c554c986a4 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.sourcemap.txt @@ -8,19 +8,19 @@ sources: sourceMapValidationDestructuringVariableStatementObjectBindingPattern1. emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js sourceFile:sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.ts ------------------------------------------------------------------- ->>>var x = ({ x: 20 }).x; +>>>var x = { x: 20 }.x; 1 > 2 >^^^^ -3 > ^^^^^^^^^^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >var { 2 > 3 > x -4 > } = { x: 20 }; +4 > } = { x: 20 }; 1 >Emitted(1, 1) Source(1, 6) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 22) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 23) Source(1, 21) + SourceIndex(0) +3 >Emitted(1, 20) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementObjectBindingPattern1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js index 771bda92ef4..44295762d6d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js @@ -3,6 +3,6 @@ var {x} = { x: 20 }; var { a, b } = { a: 30, b: 40 }; //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js] -var x = ({ x: 20 }).x; +var x = { x: 20 }.x; var _a = { a: 30, b: 40 }, a = _a.a, b = _a.b; //# sourceMappingURL=sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map index 5acc1fea7fa..eb36a3b9022 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.ts"],"names":[],"mappings":"AAAK,IAAA,iBAAC,CAAc;AAChB,IAAA,qBAA2B,EAAzB,QAAC,EAAE,QAAC,CAAsB"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.ts"],"names":[],"mappings":"AAAK,IAAA,eAAC,CAAc;AAChB,IAAA,qBAA2B,EAAzB,QAAC,EAAE,QAAC,CAAsB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.sourcemap.txt index 51c431c5da5..2390f91a8b1 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.sourcemap.txt @@ -8,20 +8,20 @@ sources: sourceMapValidationDestructuringVariableStatementObjectBindingPattern2. emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.js sourceFile:sourceMapValidationDestructuringVariableStatementObjectBindingPattern2.ts ------------------------------------------------------------------- ->>>var x = ({ x: 20 }).x; +>>>var x = { x: 20 }.x; 1 > 2 >^^^^ -3 > ^^^^^^^^^^^^^^^^^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >var { 2 > 3 > x -4 > } = { x: 20 }; +4 > } = { x: 20 }; 1 >Emitted(1, 1) Source(1, 6) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 22) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 23) Source(1, 21) + SourceIndex(0) +3 >Emitted(1, 20) Source(1, 7) + SourceIndex(0) +4 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) --- >>>var _a = { a: 30, b: 40 }, a = _a.a, b = _a.b; 1-> diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js index 3ef30f1a8aa..88a5bce4dcc 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js @@ -2,5 +2,5 @@ var {x = 500} = { x: 20 }; //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js] -var _a = ({ x: 20 }).x, x = _a === void 0 ? 500 : _a; +var _a = { x: 20 }.x, x = _a === void 0 ? 500 : _a; //# sourceMappingURL=sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map index d974f0b7c78..1faa8f8e71a 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.ts"],"names":[],"mappings":"AAAK,IAAA,kBAAO,EAAP,4BAAO,CAAc"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.ts"],"names":[],"mappings":"AAAK,IAAA,gBAAO,EAAP,4BAAO,CAAc"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.sourcemap.txt index 7c06d77cf83..d58e756de42 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.sourcemap.txt @@ -8,25 +8,25 @@ sources: sourceMapValidationDestructuringVariableStatementObjectBindingPattern3. emittedFile:tests/cases/compiler/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js sourceFile:sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.ts ------------------------------------------------------------------- ->>>var _a = ({ x: 20 }).x, x = _a === void 0 ? 500 : _a; +>>>var _a = { x: 20 }.x, x = _a === void 0 ? 500 : _a; 1 > 2 >^^^^ -3 > ^^^^^^^^^^^^^^^^^^ -4 > ^^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >var { 2 > 3 > x = 500 -4 > -5 > x = 500 -6 > } = { x: 20 }; +4 > +5 > x = 500 +6 > } = { x: 20 }; 1 >Emitted(1, 1) Source(1, 6) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 6) + SourceIndex(0) -3 >Emitted(1, 23) Source(1, 13) + SourceIndex(0) -4 >Emitted(1, 25) Source(1, 6) + SourceIndex(0) -5 >Emitted(1, 53) Source(1, 13) + SourceIndex(0) -6 >Emitted(1, 54) Source(1, 27) + SourceIndex(0) +3 >Emitted(1, 21) Source(1, 13) + SourceIndex(0) +4 >Emitted(1, 23) Source(1, 6) + SourceIndex(0) +5 >Emitted(1, 51) Source(1, 13) + SourceIndex(0) +6 >Emitted(1, 52) Source(1, 27) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.js.map \ No newline at end of file diff --git a/tests/baselines/reference/strictModeReservedWordInDestructuring.js b/tests/baselines/reference/strictModeReservedWordInDestructuring.js index 7186683bdff..78c8ab788ca 100644 --- a/tests/baselines/reference/strictModeReservedWordInDestructuring.js +++ b/tests/baselines/reference/strictModeReservedWordInDestructuring.js @@ -11,7 +11,7 @@ var { public: a, protected: b } = { public: 1, protected: 2 }; //// [strictModeReservedWordInDestructuring.js] "use strict"; var public = [1][0]; -var public = ({ x: 1 }).x; +var public = { x: 1 }.x; var private = [["hello"]][0][0]; var _a = { y: { s: 1 }, z: { o: { p: 'h' } } }, static = _a.y.s, package = _a.z.o.p; var _b = { public: 1, protected: 2 }, public = _b.public, protected = _b.protected; diff --git a/tests/baselines/reference/strictModeUseContextualKeyword.js b/tests/baselines/reference/strictModeUseContextualKeyword.js index 0e28f5828fd..6d5d3dfd5e0 100644 --- a/tests/baselines/reference/strictModeUseContextualKeyword.js +++ b/tests/baselines/reference/strictModeUseContextualKeyword.js @@ -27,5 +27,5 @@ function F() { function as() { } } function H() { - var as = ({ as: 1 }).as; + var as = { as: 1 }.as; } diff --git a/tests/baselines/reference/templateStringInObjectLiteral.js b/tests/baselines/reference/templateStringInObjectLiteral.js index 5a096b0adfa..0381e9a95e7 100644 --- a/tests/baselines/reference/templateStringInObjectLiteral.js +++ b/tests/baselines/reference/templateStringInObjectLiteral.js @@ -5,8 +5,8 @@ var x = { } //// [templateStringInObjectLiteral.js] -var x = (_a = ["b"], _a.raw = ["b"], ({ +var x = (_a = ["b"], _a.raw = ["b"], { a: "abc" + 123 + "def" -})(_a)); +}(_a)); 321; var _a; diff --git a/tests/baselines/reference/templateStringInPropertyName1.js b/tests/baselines/reference/templateStringInPropertyName1.js index 18e35c475e3..239ba78d827 100644 --- a/tests/baselines/reference/templateStringInPropertyName1.js +++ b/tests/baselines/reference/templateStringInPropertyName1.js @@ -4,6 +4,6 @@ var x = { } //// [templateStringInPropertyName1.js] -var x = (_a = ["a"], _a.raw = ["a"], ({})(_a)); +var x = (_a = ["a"], _a.raw = ["a"], {}(_a)); 321; var _a; diff --git a/tests/baselines/reference/templateStringInPropertyName2.js b/tests/baselines/reference/templateStringInPropertyName2.js index 1a2995ca08f..8a71a6e30be 100644 --- a/tests/baselines/reference/templateStringInPropertyName2.js +++ b/tests/baselines/reference/templateStringInPropertyName2.js @@ -4,6 +4,6 @@ var x = { } //// [templateStringInPropertyName2.js] -var x = (_a = ["abc", "def", "ghi"], _a.raw = ["abc", "def", "ghi"], ({})(_a, 123, 456)); +var x = (_a = ["abc", "def", "ghi"], _a.raw = ["abc", "def", "ghi"], {}(_a, 123, 456)); 321; var _a; From 76ef97449c54b175c061a5b7eccba82d8916c93a Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 19 Sep 2017 22:18:15 +0100 Subject: [PATCH 8/9] Expand test to ensure property access on object literal has correct behaviour --- .../propertyAccessOnEmptyObjectLiteral.js | 12 -------- ...propertyAccessOnEmptyObjectLiteral.symbols | 9 ------ .../propertyAccessOnEmptyObjectLiteral.types | 13 --------- .../propertyAccessOnObjectLiteral.js | 20 +++++++++++++ .../propertyAccessOnObjectLiteral.symbols | 17 +++++++++++ .../propertyAccessOnObjectLiteral.types | 29 +++++++++++++++++++ .../propertyAccessOnEmptyObjectLiteral.ts | 3 -- .../compiler/propertyAccessOnObjectLiteral.ts | 7 +++++ 8 files changed, 73 insertions(+), 37 deletions(-) delete mode 100644 tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.js delete mode 100644 tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.symbols delete mode 100644 tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.types create mode 100644 tests/baselines/reference/propertyAccessOnObjectLiteral.js create mode 100644 tests/baselines/reference/propertyAccessOnObjectLiteral.symbols create mode 100644 tests/baselines/reference/propertyAccessOnObjectLiteral.types delete mode 100644 tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts create mode 100644 tests/cases/compiler/propertyAccessOnObjectLiteral.ts diff --git a/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.js b/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.js deleted file mode 100644 index f485e4fa618..00000000000 --- a/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [propertyAccessOnEmptyObjectLiteral.ts] -class A { } - -({}).toString(); - -//// [propertyAccessOnEmptyObjectLiteral.js] -var A = /** @class */ (function () { - function A() { - } - return A; -}()); -({}).toString(); diff --git a/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.symbols b/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.symbols deleted file mode 100644 index 721cce14900..00000000000 --- a/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.symbols +++ /dev/null @@ -1,9 +0,0 @@ -=== tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts === -class A { } ->A : Symbol(A, Decl(propertyAccessOnEmptyObjectLiteral.ts, 0, 0)) - -({}).toString(); ->({}).toString : Symbol(Object.toString, Decl(lib.d.ts, --, --)) ->A : Symbol(A, Decl(propertyAccessOnEmptyObjectLiteral.ts, 0, 0)) ->toString : Symbol(Object.toString, Decl(lib.d.ts, --, --)) - diff --git a/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.types b/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.types deleted file mode 100644 index ac92f934066..00000000000 --- a/tests/baselines/reference/propertyAccessOnEmptyObjectLiteral.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts === -class A { } ->A : A - -({}).toString(); ->({}).toString() : string ->({}).toString : () => string ->({}) : A ->{} : A ->A : A ->{} : {} ->toString : () => string - diff --git a/tests/baselines/reference/propertyAccessOnObjectLiteral.js b/tests/baselines/reference/propertyAccessOnObjectLiteral.js new file mode 100644 index 00000000000..de584ece44c --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnObjectLiteral.js @@ -0,0 +1,20 @@ +//// [propertyAccessOnObjectLiteral.ts] +class A { } + +({}).toString(); + +(() => { + ({}).toString(); +})(); + + +//// [propertyAccessOnObjectLiteral.js] +var A = /** @class */ (function () { + function A() { + } + return A; +}()); +({}).toString(); +(function () { + ({}).toString(); +})(); diff --git a/tests/baselines/reference/propertyAccessOnObjectLiteral.symbols b/tests/baselines/reference/propertyAccessOnObjectLiteral.symbols new file mode 100644 index 00000000000..5d4dff2dbce --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnObjectLiteral.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/propertyAccessOnObjectLiteral.ts === +class A { } +>A : Symbol(A, Decl(propertyAccessOnObjectLiteral.ts, 0, 0)) + +({}).toString(); +>({}).toString : Symbol(Object.toString, Decl(lib.d.ts, --, --)) +>A : Symbol(A, Decl(propertyAccessOnObjectLiteral.ts, 0, 0)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, --, --)) + +(() => { + ({}).toString(); +>({}).toString : Symbol(Object.toString, Decl(lib.d.ts, --, --)) +>A : Symbol(A, Decl(propertyAccessOnObjectLiteral.ts, 0, 0)) +>toString : Symbol(Object.toString, Decl(lib.d.ts, --, --)) + +})(); + diff --git a/tests/baselines/reference/propertyAccessOnObjectLiteral.types b/tests/baselines/reference/propertyAccessOnObjectLiteral.types new file mode 100644 index 00000000000..6d12af799c8 --- /dev/null +++ b/tests/baselines/reference/propertyAccessOnObjectLiteral.types @@ -0,0 +1,29 @@ +=== tests/cases/compiler/propertyAccessOnObjectLiteral.ts === +class A { } +>A : A + +({}).toString(); +>({}).toString() : string +>({}).toString : () => string +>({}) : A +>{} : A +>A : A +>{} : {} +>toString : () => string + +(() => { +>(() => { ({}).toString();})() : void +>(() => { ({}).toString();}) : () => void +>() => { ({}).toString();} : () => void + + ({}).toString(); +>({}).toString() : string +>({}).toString : () => string +>({}) : A +>{} : A +>A : A +>{} : {} +>toString : () => string + +})(); + diff --git a/tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts b/tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts deleted file mode 100644 index 6112f269ee8..00000000000 --- a/tests/cases/compiler/propertyAccessOnEmptyObjectLiteral.ts +++ /dev/null @@ -1,3 +0,0 @@ -class A { } - -({}).toString(); \ No newline at end of file diff --git a/tests/cases/compiler/propertyAccessOnObjectLiteral.ts b/tests/cases/compiler/propertyAccessOnObjectLiteral.ts new file mode 100644 index 00000000000..89f4021e04b --- /dev/null +++ b/tests/cases/compiler/propertyAccessOnObjectLiteral.ts @@ -0,0 +1,7 @@ +class A { } + +({}).toString(); + +(() => { + ({}).toString(); +})(); From 54edde889229c228dda0064327ffa91beae27a6e Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 19 Sep 2017 23:58:03 +0100 Subject: [PATCH 9/9] Fix property access bug instead by wrapping entire access in brackets Modify parenthesizeExpressionForExpressionStatement to add brackets around an expression statement in which the left-most expression is an object literal. --- src/compiler/factory.ts | 17 ++++++----------- .../reference/propertyAccessOnObjectLiteral.js | 4 ++-- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index ebb428640da..50004ba0127 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -3875,18 +3875,14 @@ namespace ts { */ export function parenthesizeForAccess(expression: Expression): LeftHandSideExpression { // isLeftHandSideExpression is almost the correct criterion for when it is not necessary - // to parenthesize the expression before a dot. There are two known exceptions: + // to parenthesize the expression before a dot. The known exception is: // // NewExpression: // new C.x -> not the same as (new C).x // - // ObjectLiteral: - // {a:1}.toString() -> is incorrect syntax, should be ({a:1}).toString() - // const emittedExpression = skipPartiallyEmittedExpressions(expression); if (isLeftHandSideExpression(emittedExpression) - && (!isNewExpression(emittedExpression) || (emittedExpression).arguments) - && !isObjectLiteralExpression(emittedExpression)) { + && (emittedExpression.kind !== SyntaxKind.NewExpression || (emittedExpression).arguments)) { return expression; } @@ -3945,11 +3941,10 @@ namespace ts { return recreateOuterExpressions(expression, mutableCall, OuterExpressionKinds.PartiallyEmittedExpressions); } } - else { - const leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; - if (leftmostExpressionKind === SyntaxKind.ObjectLiteralExpression || leftmostExpressionKind === SyntaxKind.FunctionExpression) { - return setTextRange(createParen(expression), expression); - } + + const leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind; + if (leftmostExpressionKind === SyntaxKind.ObjectLiteralExpression || leftmostExpressionKind === SyntaxKind.FunctionExpression) { + return setTextRange(createParen(expression), expression); } return expression; diff --git a/tests/baselines/reference/propertyAccessOnObjectLiteral.js b/tests/baselines/reference/propertyAccessOnObjectLiteral.js index de584ece44c..4f1f8b042c9 100644 --- a/tests/baselines/reference/propertyAccessOnObjectLiteral.js +++ b/tests/baselines/reference/propertyAccessOnObjectLiteral.js @@ -14,7 +14,7 @@ var A = /** @class */ (function () { } return A; }()); -({}).toString(); +({}.toString()); (function () { - ({}).toString(); + ({}.toString()); })();