Skip to content

Commit ecfeb21

Browse files
Merge pull request #6004 from Microsoft/IICEs
Fix code for immediately 'new'-ed/invoked class expressions
2 parents 383cbf0 + 0252100 commit ecfeb21

File tree

3,567 files changed

+7564
-7515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,567 files changed

+7564
-7515
lines changed

src/compiler/emitter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5260,11 +5260,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
52605260
writeLine();
52615261
emitToken(SyntaxKind.CloseBraceToken, node.members.end);
52625262
emitStart(node);
5263-
write(")(");
5263+
write("(");
52645264
if (baseTypeNode) {
52655265
emit(baseTypeNode.expression);
52665266
}
5267-
write(")");
5267+
write("))");
52685268
if (node.kind === SyntaxKind.ClassDeclaration) {
52695269
write(";");
52705270
}

tests/baselines/reference/2dArrays.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ var Cell = (function () {
2020
function Cell() {
2121
}
2222
return Cell;
23-
})();
23+
}());
2424
var Ship = (function () {
2525
function Ship() {
2626
}
2727
return Ship;
28-
})();
28+
}());
2929
var Board = (function () {
3030
function Board() {
3131
}
3232
Board.prototype.allShipsSunk = function () {
3333
return this.ships.every(function (val) { return val.isSunk; });
3434
};
3535
return Board;
36-
})();
36+
}());

tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var A;
3131
this.y = y;
3232
}
3333
return Point;
34-
})();
34+
}());
3535
A.Point = Point;
3636
})(A || (A = {}));
3737
//// [test.js]

tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ var clodule1 = (function () {
5555
function clodule1() {
5656
}
5757
return clodule1;
58-
})();
58+
}());
5959
var clodule1;
6060
(function (clodule1) {
6161
function f(x) { }
@@ -64,21 +64,21 @@ var clodule2 = (function () {
6464
function clodule2() {
6565
}
6666
return clodule2;
67-
})();
67+
}());
6868
var clodule2;
6969
(function (clodule2) {
7070
var x;
7171
var D = (function () {
7272
function D() {
7373
}
7474
return D;
75-
})();
75+
}());
7676
})(clodule2 || (clodule2 = {}));
7777
var clodule3 = (function () {
7878
function clodule3() {
7979
}
8080
return clodule3;
81-
})();
81+
}());
8282
var clodule3;
8383
(function (clodule3) {
8484
clodule3.y = { id: T };
@@ -87,12 +87,12 @@ var clodule4 = (function () {
8787
function clodule4() {
8888
}
8989
return clodule4;
90-
})();
90+
}());
9191
var clodule4;
9292
(function (clodule4) {
9393
var D = (function () {
9494
function D() {
9595
}
9696
return D;
97-
})();
97+
}());
9898
})(clodule4 || (clodule4 = {}));

tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var clodule = (function () {
2121
}
2222
clodule.fn = function (id) { };
2323
return clodule;
24-
})();
24+
}());
2525
var clodule;
2626
(function (clodule) {
2727
// error: duplicate identifier expected

tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var clodule = (function () {
2121
}
2222
clodule.fn = function (id) { };
2323
return clodule;
24-
})();
24+
}());
2525
var clodule;
2626
(function (clodule) {
2727
// error: duplicate identifier expected

tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var clodule = (function () {
2121
}
2222
clodule.sfn = function (id) { return 42; };
2323
return clodule;
24-
})();
24+
}());
2525
var clodule;
2626
(function (clodule) {
2727
// error: duplicate identifier expected

tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var Point = (function () {
3030
}
3131
Point.Origin = function () { return { x: 0, y: 0 }; }; // unexpected error here bug 840246
3232
return Point;
33-
})();
33+
}());
3434
var Point;
3535
(function (Point) {
3636
function Origin() { return null; }
@@ -45,7 +45,7 @@ var A;
4545
}
4646
Point.Origin = function () { return { x: 0, y: 0 }; }; // unexpected error here bug 840246
4747
return Point;
48-
})();
48+
}());
4949
A.Point = Point;
5050
var Point;
5151
(function (Point) {

tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var Point = (function () {
3030
}
3131
Point.Origin = function () { return { x: 0, y: 0 }; };
3232
return Point;
33-
})();
33+
}());
3434
var Point;
3535
(function (Point) {
3636
function Origin() { return ""; } // not an error, since not exported
@@ -44,7 +44,7 @@ var A;
4444
}
4545
Point.Origin = function () { return { x: 0, y: 0 }; };
4646
return Point;
47-
})();
47+
}());
4848
A.Point = Point;
4949
var Point;
5050
(function (Point) {

tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var Point = (function () {
3030
}
3131
Point.Origin = { x: 0, y: 0 };
3232
return Point;
33-
})();
33+
}());
3434
var Point;
3535
(function (Point) {
3636
Point.Origin = ""; //expected duplicate identifier error
@@ -44,7 +44,7 @@ var A;
4444
}
4545
Point.Origin = { x: 0, y: 0 };
4646
return Point;
47-
})();
47+
}());
4848
A.Point = Point;
4949
var Point;
5050
(function (Point) {

0 commit comments

Comments
 (0)