46 lines
977 B
Plaintext
46 lines
977 B
Plaintext
=== tests/cases/conformance/es6/Symbols/symbolProperty47.ts ===
|
|
class C {
|
|
>C : C
|
|
|
|
get [Symbol.hasInstance]() {
|
|
>[Symbol.hasInstance] : number
|
|
>Symbol.hasInstance : symbol
|
|
>Symbol : SymbolConstructor
|
|
>hasInstance : symbol
|
|
|
|
return "";
|
|
>"" : ""
|
|
}
|
|
// Should take a string
|
|
set [Symbol.hasInstance](x: number) {
|
|
>[Symbol.hasInstance] : number
|
|
>Symbol.hasInstance : symbol
|
|
>Symbol : SymbolConstructor
|
|
>hasInstance : symbol
|
|
>x : number
|
|
}
|
|
}
|
|
|
|
(new C)[Symbol.hasInstance] = 0;
|
|
>(new C)[Symbol.hasInstance] = 0 : 0
|
|
>(new C)[Symbol.hasInstance] : number
|
|
>(new C) : C
|
|
>new C : C
|
|
>C : typeof C
|
|
>Symbol.hasInstance : symbol
|
|
>Symbol : SymbolConstructor
|
|
>hasInstance : symbol
|
|
>0 : 0
|
|
|
|
(new C)[Symbol.hasInstance] = "";
|
|
>(new C)[Symbol.hasInstance] = "" : ""
|
|
>(new C)[Symbol.hasInstance] : number
|
|
>(new C) : C
|
|
>new C : C
|
|
>C : typeof C
|
|
>Symbol.hasInstance : symbol
|
|
>Symbol : SymbolConstructor
|
|
>hasInstance : symbol
|
|
>"" : ""
|
|
|