From bc29c55882fd9120a8444fff0f1499ee17efc347 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 12 Apr 2016 16:33:06 -0700 Subject: [PATCH] Accept baselines --- .../reference/assignmentLHSIsValue.js | 2 +- .../reference/castExpressionParentheses.js | 2 +- .../reference/computedPropertyNames11_ES5.js | 10 +++++++++ ...TypedClassExpressionMethodDeclaration01.js | 8 +++---- .../declarationEmit_invalidExport.js | 2 +- ...ecoratedDefaultExportsGetExportedSystem.js | 22 +++++++++---------- ...onentiationAssignmentWithIndexingOnLHS2.js | 14 ++++++------ ...onentiationAssignmentWithIndexingOnLHS3.js | 8 +++---- .../emptyAssignmentPatterns03_ES5.js | 4 ++-- .../emptyAssignmentPatterns04_ES5.js | 4 ++-- .../noImplicitAnyInCastExpression.js | 6 ++--- 11 files changed, 46 insertions(+), 36 deletions(-) diff --git a/tests/baselines/reference/assignmentLHSIsValue.js b/tests/baselines/reference/assignmentLHSIsValue.js index 8a3b4b35d0b..ecc1cded2cc 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.js +++ b/tests/baselines/reference/assignmentLHSIsValue.js @@ -113,7 +113,7 @@ false = value; } value; // array literals -'' = value[0], '' = value[1]; +"" = value[0], "" = value[1]; // super var Derived = (function (_super) { __extends(Derived, _super); diff --git a/tests/baselines/reference/castExpressionParentheses.js b/tests/baselines/reference/castExpressionParentheses.js index b4754d0ad41..94d5daafb0a 100644 --- a/tests/baselines/reference/castExpressionParentheses.js +++ b/tests/baselines/reference/castExpressionParentheses.js @@ -53,7 +53,7 @@ new (A()); //// [castExpressionParentheses.js] // parentheses should be omitted // literals -{ a: 0 }; +({ a: 0 }); [1, 3,]; "string"; 23.0; diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.js b/tests/baselines/reference/computedPropertyNames11_ES5.js index c569c1f080c..568cce441e1 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.js +++ b/tests/baselines/reference/computedPropertyNames11_ES5.js @@ -46,6 +46,16 @@ var v = (_a = {}, enumerable: true, configurable: true }), + Object.defineProperty(_a, "", { + set: function (v) { }, + enumerable: true, + configurable: true + }), + Object.defineProperty(_a, 0, { + get: function () { return 0; }, + enumerable: true, + configurable: true + }), Object.defineProperty(_a, a, { set: function (v) { }, enumerable: true, diff --git a/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js b/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js index 2c8efdd424a..a6eaa048093 100644 --- a/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js +++ b/tests/baselines/reference/contextuallyTypedClassExpressionMethodDeclaration01.js @@ -61,7 +61,7 @@ function getFoo1() { }()); } function getFoo2() { - return (_a = (function () { + return _a = (function () { function class_2() { } return class_2; @@ -72,11 +72,11 @@ function getFoo2() { _a.method2 = function (arg) { arg.strProp = "hello"; }, - _a); + _a; var _a; } function getFoo3() { - return (_a = (function () { + return _a = (function () { function class_3() { } return class_3; @@ -87,6 +87,6 @@ function getFoo3() { _a.method2 = function (arg) { arg.strProp = "hello"; }, - _a); + _a; var _a; } diff --git a/tests/baselines/reference/declarationEmit_invalidExport.js b/tests/baselines/reference/declarationEmit_invalidExport.js index 61682ca5642..74b5bfd8019 100644 --- a/tests/baselines/reference/declarationEmit_invalidExport.js +++ b/tests/baselines/reference/declarationEmit_invalidExport.js @@ -10,5 +10,5 @@ export type MyClass = typeof myClass; //// [declarationEmit_invalidExport.js] "use strict"; if (false) { - exports.myClass = 0; + export var myClass = 0; } diff --git a/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js b/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js index d5cd115edc0..0b336bdd546 100644 --- a/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js +++ b/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.js @@ -13,19 +13,19 @@ var decorator: ClassDecorator; export default class {} //// [a.js] -System.register([], function(exports_1, context_1) { +System.register([], function (exports_1, context_1) { "use strict"; - var __moduleName = context_1 && context_1.id; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; + var __moduleName = context_1 && context_1.id; var decorator, Foo; return { - setters:[], - execute: function() { + setters: [], + execute: function () { Foo = class Foo { }; Foo = __decorate([ @@ -33,22 +33,22 @@ System.register([], function(exports_1, context_1) { ], Foo); exports_1("default", Foo); } - } + }; }); //// [b.js] -System.register([], function(exports_1, context_1) { +System.register([], function (exports_1, context_1) { "use strict"; - var __moduleName = context_1 && context_1.id; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var decorator, default_1; + var __moduleName = context_1 && context_1.id; + var decorator, default_1_1; return { - setters:[], - execute: function() { + setters: [], + execute: function () { default_1 = class { }; default_1 = __decorate([ @@ -56,5 +56,5 @@ System.register([], function(exports_1, context_1) { ], default_1); exports_1("default", default_1); } - } + }; }); diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js index 83e0b2473e8..54ef77b0467 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS2.js @@ -17,10 +17,10 @@ function foo() { globalCounter += 1; return { 0: 2 }; } -(_a = foo(), _a[0] = Math.pow(_a[0], foo()[0])); -var result_foo1 = (_b = foo(), _b[0] = Math.pow(_b[0], foo()[0])); -(_c = foo(), _c[0] = Math.pow(_c[0], (_d = foo(), _d[0] = Math.pow(_d[0], 2)))); -var result_foo2 = (_e = foo(), _e[0] = Math.pow(_e[0], (_f = foo(), _f[0] = Math.pow(_f[0], 2)))); -(_g = foo(), _g[0] = Math.pow(_g[0], Math.pow(foo()[0], 2))); -var result_foo3 = (_h = foo(), _h[0] = Math.pow(_h[0], Math.pow(foo()[0], 2))); -var _a, _b, _c, _d, _e, _f, _g, _h; +(_a = foo())[_b = 0] = Math.pow(_a[_b], foo()[0]); +var result_foo1 = (_c = foo())[_d = 0] = Math.pow(_c[_d], foo()[0]); +(_e = foo())[_f = 0] = Math.pow(_e[_f], (_g = foo())[_h = 0] = Math.pow(_g[_h], 2)); +var result_foo2 = (_j = foo())[_k = 0] = Math.pow(_j[_k], (_l = foo())[_m = 0] = Math.pow(_l[_m], 2)); +(_o = foo())[_p = 0] = Math.pow(_o[_p], Math.pow(foo()[0], 2)); +var result_foo3 = (_q = foo())[_r = 0] = Math.pow(_q[_r], Math.pow(foo()[0], 2)); +var _a, _b, _c, _d, _g, _h, _e, _f, _l, _m, _j, _k, _o, _p, _q, _r; diff --git a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js index 797ccccc331..66b9a7018fc 100644 --- a/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js +++ b/tests/baselines/reference/emitCompoundExponentiationAssignmentWithIndexingOnLHS3.js @@ -23,7 +23,7 @@ var object = { this._0 = x; }, }; -(_a = object, _a[0] = Math.pow(_a[0], object[0])); -(_b = object, _b[0] = Math.pow(_b[0], (_c = object, _c[0] = Math.pow(_c[0], 2)))); -(_d = object, _d[0] = Math.pow(_d[0], Math.pow(object[0], 2))); -var _a, _b, _c, _d; +(_a = object)[_b = 0] = Math.pow(_a[_b], object[0]); +(_c = object)[_d = 0] = Math.pow(_c[_d], (_e = object)[_f = 0] = Math.pow(_e[_f], 2)); +(_g = object)[_h = 0] = Math.pow(_g[_h], Math.pow(object[0], 2)); +var _a, _b, _e, _f, _c, _d, _g, _h; diff --git a/tests/baselines/reference/emptyAssignmentPatterns03_ES5.js b/tests/baselines/reference/emptyAssignmentPatterns03_ES5.js index adaad2e3b63..a1b605fa2e0 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns03_ES5.js +++ b/tests/baselines/reference/emptyAssignmentPatterns03_ES5.js @@ -7,8 +7,8 @@ var a: any; //// [emptyAssignmentPatterns03_ES5.js] var a; -(a); -(a); +({} = a); +([] = a); //// [emptyAssignmentPatterns03_ES5.d.ts] diff --git a/tests/baselines/reference/emptyAssignmentPatterns04_ES5.js b/tests/baselines/reference/emptyAssignmentPatterns04_ES5.js index e6b3cc7e3f2..f76420844a3 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns04_ES5.js +++ b/tests/baselines/reference/emptyAssignmentPatterns04_ES5.js @@ -9,8 +9,8 @@ let x, y, z, a1, a2, a3; //// [emptyAssignmentPatterns04_ES5.js] var a; var x, y, z, a1, a2, a3; -(_a = a, x = _a.x, y = _a.y, z = _a.z, _a); -(_b = a, a1 = _b[0], a2 = _b[1], a3 = _b[2], _b); +(_a = {} = a, x = _a.x, y = _a.y, z = _a.z, _a); +(_b = [] = a, a1 = _b[0], a2 = _b[1], a3 = _b[2], _b); var _a, _b; diff --git a/tests/baselines/reference/noImplicitAnyInCastExpression.js b/tests/baselines/reference/noImplicitAnyInCastExpression.js index 1b7cc59c7c0..b0a6907a5b4 100644 --- a/tests/baselines/reference/noImplicitAnyInCastExpression.js +++ b/tests/baselines/reference/noImplicitAnyInCastExpression.js @@ -19,8 +19,8 @@ interface IFoo { //// [noImplicitAnyInCastExpression.js] // verify no noImplictAny errors reported with cast expression // Expr type not assignable to target type -{ a: null }; +({ a: null }); // Expr type assignable to target type -{ a: 2, b: undefined }; +({ a: 2, b: undefined }); // Neither types is assignable to each other -{ c: null }; +({ c: null });