diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.js b/tests/baselines/reference/superSymbolIndexedAccess5.js new file mode 100644 index 00000000000..64a8ac5094c --- /dev/null +++ b/tests/baselines/reference/superSymbolIndexedAccess5.js @@ -0,0 +1,40 @@ +//// [superSymbolIndexedAccess5.ts] +var symbol: any; + +class Foo { + [symbol]() { + return 0; + } +} + +class Bar extends Foo { + [symbol]() { + return super[symbol](); + } +} + +//// [superSymbolIndexedAccess5.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var symbol; +var Foo = (function () { + function Foo() { + } + Foo.prototype[symbol] = function () { + return 0; + }; + return Foo; +})(); +var Bar = (function (_super) { + __extends(Bar, _super); + function Bar() { + _super.apply(this, arguments); + } + Bar.prototype[symbol] = function () { + return _super.prototype[symbol](); + }; + return Bar; +})(Foo); diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.symbols b/tests/baselines/reference/superSymbolIndexedAccess5.symbols new file mode 100644 index 00000000000..98ff04a25cd --- /dev/null +++ b/tests/baselines/reference/superSymbolIndexedAccess5.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess5.ts === +var symbol: any; +>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess5.ts, 0, 3)) + +class Foo { +>Foo : Symbol(Foo, Decl(superSymbolIndexedAccess5.ts, 0, 16)) + + [symbol]() { +>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess5.ts, 0, 3)) + + return 0; + } +} + +class Bar extends Foo { +>Bar : Symbol(Bar, Decl(superSymbolIndexedAccess5.ts, 6, 1)) +>Foo : Symbol(Foo, Decl(superSymbolIndexedAccess5.ts, 0, 16)) + + [symbol]() { +>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess5.ts, 0, 3)) + + return super[symbol](); +>super : Symbol(Foo, Decl(superSymbolIndexedAccess5.ts, 0, 16)) +>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess5.ts, 0, 3)) + } +} diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.types b/tests/baselines/reference/superSymbolIndexedAccess5.types new file mode 100644 index 00000000000..abc3ba364b0 --- /dev/null +++ b/tests/baselines/reference/superSymbolIndexedAccess5.types @@ -0,0 +1,29 @@ +=== tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess5.ts === +var symbol: any; +>symbol : any + +class Foo { +>Foo : Foo + + [symbol]() { +>symbol : any + + return 0; +>0 : number + } +} + +class Bar extends Foo { +>Bar : Bar +>Foo : Foo + + [symbol]() { +>symbol : any + + return super[symbol](); +>super[symbol]() : any +>super[symbol] : any +>super : Foo +>symbol : any + } +} diff --git a/tests/baselines/reference/superSymbolIndexedAccess6.js b/tests/baselines/reference/superSymbolIndexedAccess6.js new file mode 100644 index 00000000000..e014cf47c1a --- /dev/null +++ b/tests/baselines/reference/superSymbolIndexedAccess6.js @@ -0,0 +1,40 @@ +//// [superSymbolIndexedAccess6.ts] +var symbol: any; + +class Foo { + static [symbol]() { + return 0; + } +} + +class Bar extends Foo { + static [symbol]() { + return super[symbol](); + } +} + +//// [superSymbolIndexedAccess6.js] +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var symbol; +var Foo = (function () { + function Foo() { + } + Foo[symbol] = function () { + return 0; + }; + return Foo; +})(); +var Bar = (function (_super) { + __extends(Bar, _super); + function Bar() { + _super.apply(this, arguments); + } + Bar[symbol] = function () { + return _super[symbol](); + }; + return Bar; +})(Foo); diff --git a/tests/baselines/reference/superSymbolIndexedAccess6.symbols b/tests/baselines/reference/superSymbolIndexedAccess6.symbols new file mode 100644 index 00000000000..a79a6552674 --- /dev/null +++ b/tests/baselines/reference/superSymbolIndexedAccess6.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess6.ts === +var symbol: any; +>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess6.ts, 0, 3)) + +class Foo { +>Foo : Symbol(Foo, Decl(superSymbolIndexedAccess6.ts, 0, 16)) + + static [symbol]() { +>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess6.ts, 0, 3)) + + return 0; + } +} + +class Bar extends Foo { +>Bar : Symbol(Bar, Decl(superSymbolIndexedAccess6.ts, 6, 1)) +>Foo : Symbol(Foo, Decl(superSymbolIndexedAccess6.ts, 0, 16)) + + static [symbol]() { +>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess6.ts, 0, 3)) + + return super[symbol](); +>super : Symbol(Foo, Decl(superSymbolIndexedAccess6.ts, 0, 16)) +>symbol : Symbol(symbol, Decl(superSymbolIndexedAccess6.ts, 0, 3)) + } +} diff --git a/tests/baselines/reference/superSymbolIndexedAccess6.types b/tests/baselines/reference/superSymbolIndexedAccess6.types new file mode 100644 index 00000000000..830ade0c685 --- /dev/null +++ b/tests/baselines/reference/superSymbolIndexedAccess6.types @@ -0,0 +1,29 @@ +=== tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess6.ts === +var symbol: any; +>symbol : any + +class Foo { +>Foo : Foo + + static [symbol]() { +>symbol : any + + return 0; +>0 : number + } +} + +class Bar extends Foo { +>Bar : Bar +>Foo : Foo + + static [symbol]() { +>symbol : any + + return super[symbol](); +>super[symbol]() : any +>super[symbol] : any +>super : typeof Foo +>symbol : any + } +} diff --git a/tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess5.ts b/tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess5.ts new file mode 100644 index 00000000000..3c1a376eab6 --- /dev/null +++ b/tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess5.ts @@ -0,0 +1,14 @@ +//@target: ES5 +var symbol: any; + +class Foo { + [symbol]() { + return 0; + } +} + +class Bar extends Foo { + [symbol]() { + return super[symbol](); + } +} \ No newline at end of file diff --git a/tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess6.ts b/tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess6.ts new file mode 100644 index 00000000000..3850821e9f3 --- /dev/null +++ b/tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess6.ts @@ -0,0 +1,14 @@ +//@target: ES5 +var symbol: any; + +class Foo { + static [symbol]() { + return 0; + } +} + +class Bar extends Foo { + static [symbol]() { + return super[symbol](); + } +} \ No newline at end of file