2015-02-06 02:18:32 +01:00
|
|
|
=== tests/cases/conformance/es6/Symbols/symbolProperty18.ts ===
|
|
|
|
var i = {
|
2015-04-13 23:01:57 +02:00
|
|
|
>i : { [Symbol.iterator]: number; [Symbol.toStringTag](): string; [Symbol.toPrimitive]: boolean; }, Symbol(i, Decl(symbolProperty18.ts, 0, 3))
|
2015-02-06 02:18:32 +01:00
|
|
|
>{ [Symbol.iterator]: 0, [Symbol.toStringTag]() { return "" }, set [Symbol.toPrimitive](p: boolean) { }} : { [Symbol.iterator]: number; [Symbol.toStringTag](): string; [Symbol.toPrimitive]: boolean; }
|
|
|
|
|
|
|
|
[Symbol.iterator]: 0,
|
2015-04-13 23:01:57 +02:00
|
|
|
>Symbol.iterator : symbol, Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31))
|
|
|
|
>Symbol : SymbolConstructor, Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11))
|
|
|
|
>iterator : symbol, Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31))
|
2015-04-13 21:36:11 +02:00
|
|
|
>0 : number
|
2015-02-06 02:18:32 +01:00
|
|
|
|
|
|
|
[Symbol.toStringTag]() { return "" },
|
2015-04-13 23:01:57 +02:00
|
|
|
>Symbol.toStringTag : symbol, Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24))
|
|
|
|
>Symbol : SymbolConstructor, Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11))
|
|
|
|
>toStringTag : symbol, Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2015-02-06 02:18:32 +01:00
|
|
|
|
|
|
|
set [Symbol.toPrimitive](p: boolean) { }
|
2015-04-13 23:01:57 +02:00
|
|
|
>Symbol.toPrimitive : symbol, Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21))
|
|
|
|
>Symbol : SymbolConstructor, Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11))
|
|
|
|
>toPrimitive : symbol, Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21))
|
|
|
|
>p : boolean, Symbol(p, Decl(symbolProperty18.ts, 3, 29))
|
2015-02-06 02:18:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
var it = i[Symbol.iterator];
|
2015-04-13 23:01:57 +02:00
|
|
|
>it : number, Symbol(it, Decl(symbolProperty18.ts, 6, 3))
|
2015-02-06 02:18:32 +01:00
|
|
|
>i[Symbol.iterator] : number
|
2015-04-13 23:01:57 +02:00
|
|
|
>i : { [Symbol.iterator]: number; [Symbol.toStringTag](): string; [Symbol.toPrimitive]: boolean; }, Symbol(i, Decl(symbolProperty18.ts, 0, 3))
|
|
|
|
>Symbol.iterator : symbol, Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31))
|
|
|
|
>Symbol : SymbolConstructor, Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11))
|
|
|
|
>iterator : symbol, Symbol(SymbolConstructor.iterator, Decl(lib.d.ts, 1236, 31))
|
2015-02-06 02:18:32 +01:00
|
|
|
|
|
|
|
var str = i[Symbol.toStringTag]();
|
2015-04-13 23:01:57 +02:00
|
|
|
>str : string, Symbol(str, Decl(symbolProperty18.ts, 7, 3))
|
2015-02-06 02:18:32 +01:00
|
|
|
>i[Symbol.toStringTag]() : string
|
|
|
|
>i[Symbol.toStringTag] : () => string
|
2015-04-13 23:01:57 +02:00
|
|
|
>i : { [Symbol.iterator]: number; [Symbol.toStringTag](): string; [Symbol.toPrimitive]: boolean; }, Symbol(i, Decl(symbolProperty18.ts, 0, 3))
|
|
|
|
>Symbol.toStringTag : symbol, Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24))
|
|
|
|
>Symbol : SymbolConstructor, Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11))
|
|
|
|
>toStringTag : symbol, Symbol(SymbolConstructor.toStringTag, Decl(lib.d.ts, 1248, 24))
|
2015-02-06 02:18:32 +01:00
|
|
|
|
|
|
|
i[Symbol.toPrimitive] = false;
|
|
|
|
>i[Symbol.toPrimitive] = false : boolean
|
|
|
|
>i[Symbol.toPrimitive] : boolean
|
2015-04-13 23:01:57 +02:00
|
|
|
>i : { [Symbol.iterator]: number; [Symbol.toStringTag](): string; [Symbol.toPrimitive]: boolean; }, Symbol(i, Decl(symbolProperty18.ts, 0, 3))
|
|
|
|
>Symbol.toPrimitive : symbol, Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21))
|
|
|
|
>Symbol : SymbolConstructor, Symbol(Symbol, Decl(lib.d.ts, 1186, 52), Decl(lib.d.ts, 1262, 11))
|
|
|
|
>toPrimitive : symbol, Symbol(SymbolConstructor.toPrimitive, Decl(lib.d.ts, 1242, 21))
|
2015-04-13 21:36:11 +02:00
|
|
|
>false : boolean
|
2015-02-06 02:18:32 +01:00
|
|
|
|