29 lines
851 B
Text
29 lines
851 B
Text
=== tests/cases/conformance/es6/Symbols/symbolProperty55.ts ===
|
|
var obj = {
|
|
>obj : { [Symbol.iterator]: number; }
|
|
>{ [Symbol.iterator]: 0} : { [Symbol.iterator]: number; }
|
|
|
|
[Symbol.iterator]: 0
|
|
>Symbol.iterator : symbol
|
|
>Symbol : SymbolConstructor
|
|
>iterator : symbol
|
|
>0 : number
|
|
|
|
};
|
|
|
|
module M {
|
|
>M : typeof M
|
|
|
|
var Symbol: SymbolConstructor;
|
|
>Symbol : SymbolConstructor
|
|
>SymbolConstructor : SymbolConstructor
|
|
|
|
// The following should be of type 'any'. This is because even though obj has a property keyed by Symbol.iterator,
|
|
// the key passed in here is the *wrong* Symbol.iterator. It is not the iterator property of the global Symbol.
|
|
obj[Symbol.iterator];
|
|
>obj[Symbol.iterator] : any
|
|
>obj : { [Symbol.iterator]: number; }
|
|
>Symbol.iterator : symbol
|
|
>Symbol : SymbolConstructor
|
|
>iterator : symbol
|
|
}
|