Skip to content

Commit cb4a408

Browse files
committed
add baselines
1 parent 0057652 commit cb4a408

10 files changed

+101
-85
lines changed

tests/baselines/reference/undefinedTypeAssignment.errors.txt

Lines changed: 0 additions & 43 deletions
This file was deleted.

tests/baselines/reference/undefinedTypeAssignment.js

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
tests/cases/compiler/undefinedTypeAssignment1.ts(1,1): error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
2+
3+
4+
==== tests/cases/compiler/undefinedTypeAssignment1.ts (1 errors) ====
5+
type undefined = string;
6+
~~~~~~~~~~~~~~~~~~~~~~~~
7+
!!! error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
8+
function p(undefined = "wat") {
9+
return undefined;
10+
}
11+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//// [undefinedTypeAssignment1.ts]
2+
type undefined = string;
3+
function p(undefined = "wat") {
4+
return undefined;
5+
}
6+
7+
8+
//// [undefinedTypeAssignment1.js]
9+
function p(undefined) {
10+
if (undefined === void 0) { undefined = "wat"; }
11+
return undefined;
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
tests/cases/compiler/undefinedTypeAssignment2.ts(1,5): error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
2+
3+
4+
==== tests/cases/compiler/undefinedTypeAssignment2.ts (1 errors) ====
5+
var undefined = void 0;
6+
~~~~~~~~~
7+
!!! error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
8+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//// [undefinedTypeAssignment2.ts]
2+
var undefined = void 0;
3+
4+
5+
//// [undefinedTypeAssignment2.js]
6+
var undefined = void 0;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
tests/cases/compiler/undefinedTypeAssignment3.ts(1,5): error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
2+
3+
4+
==== tests/cases/compiler/undefinedTypeAssignment3.ts (1 errors) ====
5+
var undefined = null;
6+
~~~~~~~~~
7+
!!! error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
8+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//// [undefinedTypeAssignment3.ts]
2+
var undefined = null;
3+
4+
5+
//// [undefinedTypeAssignment3.js]
6+
var undefined = null;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
tests/cases/compiler/undefinedTypeAssignment4.ts(1,7): error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
2+
tests/cases/compiler/undefinedTypeAssignment4.ts(4,11): error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
3+
tests/cases/compiler/undefinedTypeAssignment4.ts(7,11): error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
4+
5+
6+
==== tests/cases/compiler/undefinedTypeAssignment4.ts (3 errors) ====
7+
class undefined {
8+
~~~~~~~~~
9+
!!! error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
10+
foo: string;
11+
}
12+
interface undefined {
13+
~~~~~~~~~
14+
!!! error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
15+
member: number;
16+
}
17+
namespace undefined {
18+
~~~~~~~~~
19+
!!! error TS2397: Declaration name conflicts with built-in global identifier 'undefined'.
20+
export var x = 42;
21+
}
22+
var x: undefined;
23+
var y: typeof undefined;
24+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//// [undefinedTypeAssignment4.ts]
2+
class undefined {
3+
foo: string;
4+
}
5+
interface undefined {
6+
member: number;
7+
}
8+
namespace undefined {
9+
export var x = 42;
10+
}
11+
var x: undefined;
12+
var y: typeof undefined;
13+
14+
15+
//// [undefinedTypeAssignment4.js]
16+
var undefined = (function () {
17+
function undefined() {
18+
}
19+
return undefined;
20+
})();
21+
var undefined;
22+
(function (undefined) {
23+
undefined.x = 42;
24+
})(undefined || (undefined = {}));
25+
var x;
26+
var y;

0 commit comments

Comments
 (0)