35 lines
664 B
Text
35 lines
664 B
Text
=== tests/cases/conformance/es6/Symbols/symbolProperty28.ts ===
|
|
class C1 {
|
|
>C1 : C1
|
|
|
|
[Symbol.toStringTag]() {
|
|
>Symbol.toStringTag : symbol
|
|
>Symbol : SymbolConstructor
|
|
>toStringTag : symbol
|
|
|
|
return { x: "" };
|
|
>{ x: "" } : { x: string; }
|
|
>x : string
|
|
>"" : string
|
|
}
|
|
}
|
|
|
|
class C2 extends C1 { }
|
|
>C2 : C2
|
|
>C1 : C1
|
|
|
|
var c: C2;
|
|
>c : C2
|
|
>C2 : C2
|
|
|
|
var obj = c[Symbol.toStringTag]().x;
|
|
>obj : string
|
|
>c[Symbol.toStringTag]().x : string
|
|
>c[Symbol.toStringTag]() : { x: string; }
|
|
>c[Symbol.toStringTag] : () => { x: string; }
|
|
>c : C2
|
|
>Symbol.toStringTag : symbol
|
|
>Symbol : SymbolConstructor
|
|
>toStringTag : symbol
|
|
>x : string
|
|
|