Skip to content

Commit 8e5f34f

Browse files
committed
Add downlevel emit tests
1 parent 75f97f3 commit 8e5f34f

8 files changed

+218
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//// [superSymbolIndexedAccess5.ts]
2+
var symbol: any;
3+
4+
class Foo {
5+
[symbol]() {
6+
return 0;
7+
}
8+
}
9+
10+
class Bar extends Foo {
11+
[symbol]() {
12+
return super[symbol]();
13+
}
14+
}
15+
16+
//// [superSymbolIndexedAccess5.js]
17+
var __extends = (this && this.__extends) || function (d, b) {
18+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
19+
function __() { this.constructor = d; }
20+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
21+
};
22+
var symbol;
23+
var Foo = (function () {
24+
function Foo() {
25+
}
26+
Foo.prototype[symbol] = function () {
27+
return 0;
28+
};
29+
return Foo;
30+
})();
31+
var Bar = (function (_super) {
32+
__extends(Bar, _super);
33+
function Bar() {
34+
_super.apply(this, arguments);
35+
}
36+
Bar.prototype[symbol] = function () {
37+
return _super.prototype[symbol]();
38+
};
39+
return Bar;
40+
})(Foo);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
=== tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess5.ts ===
2+
var symbol: any;
3+
>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess5.ts, 0, 3))
4+
5+
class Foo {
6+
>Foo : Symbol(Foo, Decl(superSymbolIndexedAccess5.ts, 0, 16))
7+
8+
[symbol]() {
9+
>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess5.ts, 0, 3))
10+
11+
return 0;
12+
}
13+
}
14+
15+
class Bar extends Foo {
16+
>Bar : Symbol(Bar, Decl(superSymbolIndexedAccess5.ts, 6, 1))
17+
>Foo : Symbol(Foo, Decl(superSymbolIndexedAccess5.ts, 0, 16))
18+
19+
[symbol]() {
20+
>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess5.ts, 0, 3))
21+
22+
return super[symbol]();
23+
>super : Symbol(Foo, Decl(superSymbolIndexedAccess5.ts, 0, 16))
24+
>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess5.ts, 0, 3))
25+
}
26+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
=== tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess5.ts ===
2+
var symbol: any;
3+
>symbol : any
4+
5+
class Foo {
6+
>Foo : Foo
7+
8+
[symbol]() {
9+
>symbol : any
10+
11+
return 0;
12+
>0 : number
13+
}
14+
}
15+
16+
class Bar extends Foo {
17+
>Bar : Bar
18+
>Foo : Foo
19+
20+
[symbol]() {
21+
>symbol : any
22+
23+
return super[symbol]();
24+
>super[symbol]() : any
25+
>super[symbol] : any
26+
>super : Foo
27+
>symbol : any
28+
}
29+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//// [superSymbolIndexedAccess6.ts]
2+
var symbol: any;
3+
4+
class Foo {
5+
static [symbol]() {
6+
return 0;
7+
}
8+
}
9+
10+
class Bar extends Foo {
11+
static [symbol]() {
12+
return super[symbol]();
13+
}
14+
}
15+
16+
//// [superSymbolIndexedAccess6.js]
17+
var __extends = (this && this.__extends) || function (d, b) {
18+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
19+
function __() { this.constructor = d; }
20+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
21+
};
22+
var symbol;
23+
var Foo = (function () {
24+
function Foo() {
25+
}
26+
Foo[symbol] = function () {
27+
return 0;
28+
};
29+
return Foo;
30+
})();
31+
var Bar = (function (_super) {
32+
__extends(Bar, _super);
33+
function Bar() {
34+
_super.apply(this, arguments);
35+
}
36+
Bar[symbol] = function () {
37+
return _super[symbol]();
38+
};
39+
return Bar;
40+
})(Foo);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
=== tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess6.ts ===
2+
var symbol: any;
3+
>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess6.ts, 0, 3))
4+
5+
class Foo {
6+
>Foo : Symbol(Foo, Decl(superSymbolIndexedAccess6.ts, 0, 16))
7+
8+
static [symbol]() {
9+
>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess6.ts, 0, 3))
10+
11+
return 0;
12+
}
13+
}
14+
15+
class Bar extends Foo {
16+
>Bar : Symbol(Bar, Decl(superSymbolIndexedAccess6.ts, 6, 1))
17+
>Foo : Symbol(Foo, Decl(superSymbolIndexedAccess6.ts, 0, 16))
18+
19+
static [symbol]() {
20+
>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess6.ts, 0, 3))
21+
22+
return super[symbol]();
23+
>super : Symbol(Foo, Decl(superSymbolIndexedAccess6.ts, 0, 16))
24+
>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess6.ts, 0, 3))
25+
}
26+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
=== tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess6.ts ===
2+
var symbol: any;
3+
>symbol : any
4+
5+
class Foo {
6+
>Foo : Foo
7+
8+
static [symbol]() {
9+
>symbol : any
10+
11+
return 0;
12+
>0 : number
13+
}
14+
}
15+
16+
class Bar extends Foo {
17+
>Bar : Bar
18+
>Foo : Foo
19+
20+
static [symbol]() {
21+
>symbol : any
22+
23+
return super[symbol]();
24+
>super[symbol]() : any
25+
>super[symbol] : any
26+
>super : typeof Foo
27+
>symbol : any
28+
}
29+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@target: ES5
2+
var symbol: any;
3+
4+
class Foo {
5+
[symbol]() {
6+
return 0;
7+
}
8+
}
9+
10+
class Bar extends Foo {
11+
[symbol]() {
12+
return super[symbol]();
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@target: ES5
2+
var symbol: any;
3+
4+
class Foo {
5+
static [symbol]() {
6+
return 0;
7+
}
8+
}
9+
10+
class Bar extends Foo {
11+
static [symbol]() {
12+
return super[symbol]();
13+
}
14+
}

0 commit comments

Comments
 (0)