53 lines
1.2 KiB
Text
53 lines
1.2 KiB
Text
=== tests/cases/conformance/es6/Symbols/symbolProperty41.ts ===
|
|
class C {
|
|
>C : C
|
|
|
|
[Symbol.iterator](x: string): { x: string };
|
|
>Symbol.iterator : symbol
|
|
>Symbol : SymbolConstructor
|
|
>iterator : symbol
|
|
>x : string
|
|
>x : string
|
|
|
|
[Symbol.iterator](x: "hello"): { x: string; hello: string };
|
|
>Symbol.iterator : symbol
|
|
>Symbol : SymbolConstructor
|
|
>iterator : symbol
|
|
>x : "hello"
|
|
>x : string
|
|
>hello : string
|
|
|
|
[Symbol.iterator](x: any) {
|
|
>Symbol.iterator : symbol
|
|
>Symbol : SymbolConstructor
|
|
>iterator : symbol
|
|
>x : any
|
|
|
|
return undefined;
|
|
>undefined : undefined
|
|
}
|
|
}
|
|
|
|
var c = new C;
|
|
>c : C
|
|
>new C : C
|
|
>C : typeof C
|
|
|
|
c[Symbol.iterator]("");
|
|
>c[Symbol.iterator]("") : { x: string; }
|
|
>c[Symbol.iterator] : { (x: string): { x: string; }; (x: "hello"): { x: string; hello: string; }; }
|
|
>c : C
|
|
>Symbol.iterator : symbol
|
|
>Symbol : SymbolConstructor
|
|
>iterator : symbol
|
|
>"" : string
|
|
|
|
c[Symbol.iterator]("hello");
|
|
>c[Symbol.iterator]("hello") : { x: string; hello: string; }
|
|
>c[Symbol.iterator] : { (x: string): { x: string; }; (x: "hello"): { x: string; hello: string; }; }
|
|
>c : C
|
|
>Symbol.iterator : symbol
|
|
>Symbol : SymbolConstructor
|
|
>iterator : symbol
|
|
>"hello" : string
|
|
|