Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ export const targetOptionDeclaration: CommandLineOptionOfCustomType = {
showInSimplifiedHelpView: true,
category: Diagnostics.Language_and_Environment,
description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
defaultValueDescription: ScriptTarget.ES5,
defaultValueDescription: ScriptTarget.ESNext,
};

/** @internal */
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8989,7 +8989,7 @@ const _computedOptions = createComputedCompilerOptions({
(compilerOptions.module === ModuleKind.Node18 && ScriptTarget.ES2022) ||
(compilerOptions.module === ModuleKind.Node20 && ScriptTarget.ES2023) ||
(compilerOptions.module === ModuleKind.NodeNext && ScriptTarget.ESNext) ||
ScriptTarget.ES5);
ScriptTarget.ESNext);
},
},
module: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000
//// [classPoint.js]
var A;
(function (A) {
var Point = /** @class */ (function () {
function Point(x, y) {
class Point {
x;
y;
constructor(x, y) {
this.x = x;
this.y = y;
}
return Point;
}());
}
A.Point = Point;
})(A || (A = {}));
//// [test.js]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,44 +53,37 @@ module clodule4 {

//// [ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.js]
// all expected to be errors
var clodule1 = /** @class */ (function () {
function clodule1() {
}
return clodule1;
}());
class clodule1 {
id;
value;
}
(function (clodule1) {
function f(x) { }
})(clodule1 || (clodule1 = {}));
var clodule2 = /** @class */ (function () {
function clodule2() {
}
return clodule2;
}());
class clodule2 {
id;
value;
}
(function (clodule2) {
var x;
var D = /** @class */ (function () {
function D() {
}
return D;
}());
})(clodule2 || (clodule2 = {}));
var clodule3 = /** @class */ (function () {
function clodule3() {
class D {
id;
value;
}
return clodule3;
}());
})(clodule2 || (clodule2 = {}));
class clodule3 {
id;
value;
}
(function (clodule3) {
clodule3.y = { id: T };
})(clodule3 || (clodule3 = {}));
var clodule4 = /** @class */ (function () {
function clodule4() {
}
return clodule4;
}());
class clodule4 {
id;
value;
}
(function (clodule4) {
var D = /** @class */ (function () {
function D() {
}
return D;
}());
class D {
name;
}
})(clodule4 || (clodule4 = {}));
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ module clodule {


//// [ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.js]
var clodule = /** @class */ (function () {
function clodule() {
}
clodule.fn = function (id) { };
return clodule;
}());
class clodule {
id;
value;
static fn(id) { }
}
(function (clodule) {
// error: duplicate identifier expected
function fn(x, y) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ module clodule {


//// [ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.js]
var clodule = /** @class */ (function () {
function clodule() {
}
clodule.fn = function (id) { };
return clodule;
}());
class clodule {
id;
value;
static fn(id) { }
}
(function (clodule) {
// error: duplicate identifier expected
function fn(x, y) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ module clodule {


//// [ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.js]
var clodule = /** @class */ (function () {
function clodule() {
}
clodule.sfn = function (id) { return 42; };
return clodule;
}());
class clodule {
id;
value;
static sfn(id) { return 42; }
}
(function (clodule) {
// error: duplicate identifier expected
function fn(x, y) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,30 @@ module A {
}

//// [ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js]
var Point = /** @class */ (function () {
function Point(x, y) {
class Point {
x;
y;
constructor(x, y) {
this.x = x;
this.y = y;
}
Point.Origin = function () { return { x: 0, y: 0 }; }; // unexpected error here bug 840246
return Point;
}());
static Origin() { return { x: 0, y: 0 }; } // unexpected error here bug 840246
}
(function (Point) {
function Origin() { return null; } //expected duplicate identifier error
Point.Origin = Origin;
})(Point || (Point = {}));
var A;
(function (A) {
var Point = /** @class */ (function () {
function Point(x, y) {
class Point {
x;
y;
constructor(x, y) {
this.x = x;
this.y = y;
}
Point.Origin = function () { return { x: 0, y: 0 }; }; // unexpected error here bug 840246
return Point;
}());
static Origin() { return { x: 0, y: 0 }; } // unexpected error here bug 840246
}
A.Point = Point;
(function (Point) {
function Origin() { return ""; } //expected duplicate identifier error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,29 @@ module A {
}

//// [ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js]
var Point = /** @class */ (function () {
function Point(x, y) {
class Point {
x;
y;
constructor(x, y) {
this.x = x;
this.y = y;
}
Point.Origin = function () { return { x: 0, y: 0 }; };
return Point;
}());
static Origin() { return { x: 0, y: 0 }; }
}
(function (Point) {
function Origin() { return ""; } // not an error, since not exported
})(Point || (Point = {}));
var A;
(function (A) {
var Point = /** @class */ (function () {
function Point(x, y) {
class Point {
x;
y;
constructor(x, y) {
this.x = x;
this.y = y;
}
Point.Origin = function () { return { x: 0, y: 0 }; };
return Point;
}());
static Origin() { return { x: 0, y: 0 }; }
}
A.Point = Point;
(function (Point) {
function Origin() { return ""; } // not an error since not exported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,29 @@ module A {
}

//// [ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js]
var Point = /** @class */ (function () {
function Point(x, y) {
class Point {
x;
y;
constructor(x, y) {
this.x = x;
this.y = y;
}
Point.Origin = { x: 0, y: 0 };
return Point;
}());
static Origin = { x: 0, y: 0 };
}
(function (Point) {
Point.Origin = ""; //expected duplicate identifier error
})(Point || (Point = {}));
var A;
(function (A) {
var Point = /** @class */ (function () {
function Point(x, y) {
class Point {
x;
y;
constructor(x, y) {
this.x = x;
this.y = y;
}
Point.Origin = { x: 0, y: 0 };
return Point;
}());
static Origin = { x: 0, y: 0 };
}
A.Point = Point;
(function (Point) {
Point.Origin = ""; //expected duplicate identifier error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,29 @@ module A {
}

//// [ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js]
var Point = /** @class */ (function () {
function Point(x, y) {
class Point {
x;
y;
constructor(x, y) {
this.x = x;
this.y = y;
}
Point.Origin = { x: 0, y: 0 };
return Point;
}());
static Origin = { x: 0, y: 0 };
}
(function (Point) {
var Origin = ""; // not an error, since not exported
})(Point || (Point = {}));
var A;
(function (A) {
var Point = /** @class */ (function () {
function Point(x, y) {
class Point {
x;
y;
constructor(x, y) {
this.x = x;
this.y = y;
}
Point.Origin = { x: 0, y: 0 };
return Point;
}());
static Origin = { x: 0, y: 0 };
}
A.Point = Point;
(function (Point) {
var Origin = ""; // not an error since not exported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ var X;
(function (X) {
var Y;
(function (Y) {
var Point = /** @class */ (function () {
function Point(x, y) {
class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
return Point;
}());
x;
y;
}
Y.Point = Point;
})(Y = X.Y || (X.Y = {}));
})(X || (X = {}));
Expand All @@ -60,7 +61,7 @@ var X;
(function (X) {
var Y;
(function (Y) {
var Point;
let Point;
(function (Point) {
Point.Origin = new Point(0, 0);
})(Point = Y.Point || (Y.Point = {}));
Expand All @@ -71,11 +72,9 @@ var X;
var cl = new X.Y.Point(1, 1);
var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
//// [simple.js]
var A = /** @class */ (function () {
function A() {
}
return A;
}());
class A {
id;
}
(function (A) {
A.Instance = new A();
})(A || (A = {}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ var enumdule;
enumdule[enumdule["Blue"] = 1] = "Blue";
})(enumdule || (enumdule = {}));
(function (enumdule) {
var Point = /** @class */ (function () {
function Point(x, y) {
class Point {
x;
y;
constructor(x, y) {
this.x = x;
this.y = y;
}
return Point;
}());
}
enumdule.Point = Point;
})(enumdule || (enumdule = {}));
var x;
Expand Down
Loading
Loading