Home
last modified time | relevance | path

Searched refs:toPrimitive (Results 1 – 25 of 144) sorted by relevance

123456

/third_party/node/deps/npm/node_modules/es-to-primitive/test/
Des6.js4 var toPrimitive = require('../es6'); variable
11 var hasSymbolToPrimitive = hasSymbols && typeof Symbol.toPrimitive === 'symbol';
14 t.equal(toPrimitive.length, 1, 'length is 1');
15 t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive');
24 t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value');
25 …t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value'…
26 …t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value'…
38 t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value');
39 …t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same v…
40 …t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same v…
[all …]
Des2015.js4 var toPrimitive = require('../es2015'); variable
11 var hasSymbolToPrimitive = hasSymbols && typeof Symbol.toPrimitive === 'symbol';
14 t.equal(toPrimitive.length, 1, 'length is 1');
15 t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive');
24 t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value');
25 …t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value'…
26 …t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value'…
38 t.equal(toPrimitive(sym), sym, 'toPrimitive(' + debug(sym) + ') returns the same value');
39 …t.equal(toPrimitive(sym, String), sym, 'toPrimitive(' + debug(sym) + ', String) returns the same v…
40 …t.equal(toPrimitive(sym, Number), sym, 'toPrimitive(' + debug(sym) + ', Number) returns the same v…
[all …]
Des5.js4 var toPrimitive = require('../es5'); variable
11 t.equal(toPrimitive.length, 1, 'length is 1');
12 t.equal(functionName(toPrimitive), 'ToPrimitive', 'name is ToPrimitive');
21 t.ok(is(toPrimitive(i), i), 'toPrimitive(' + debug(i) + ') returns the same value');
22 …t.ok(is(toPrimitive(i, String), i), 'toPrimitive(' + debug(i) + ', String) returns the same value'…
23 …t.ok(is(toPrimitive(i, Number), i), 'toPrimitive(' + debug(i) + ', Number) returns the same value'…
31 …t.ok(is(toPrimitive(arr), arr.toString()), 'toPrimitive(' + debug(arr) + ') returns toString of th…
32 …t.equal(toPrimitive(arr, String), arr.toString(), 'toPrimitive(' + debug(arr) + ') returns toStrin…
33 …t.ok(is(toPrimitive(arr, Number), arr.toString()), 'toPrimitive(' + debug(arr) + ') returns toStri…
41 …t.equal(toPrimitive(date), date.toString(), 'toPrimitive(' + debug(date) + ') returns toString of …
[all …]
/third_party/typescript/tests/baselines/reference/
DsymbolDeclarationEmit3.symbols5 [Symbol.toPrimitive](x: number);
6 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit3.ts, 0, 9), Decl(s…
7 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
9 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
12 [Symbol.toPrimitive](x: string);
13 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit3.ts, 0, 9), Decl(s…
14 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
16 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
19 [Symbol.toPrimitive](x: any) { }
20 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit3.ts, 0, 9), Decl(s…
[all …]
DsymbolDeclarationEmit12.symbols18 [Symbol.toPrimitive](x: I) { }
19 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit12.ts, 3, 29))
20 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
22 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
36 get [Symbol.toPrimitive]() { return undefined; }
37 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit12.ts, 7, 9))
38 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
40 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
43 set [Symbol.toPrimitive](x: I) { }
44 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit12.ts, 8, 56))
[all …]
DsymbolProperty18.types3 >i : { [Symbol.iterator]: number; [Symbol.toStringTag](): string; [Symbol.toPrimitive]: boolean; }
4 …" }, set [Symbol.toPrimitive](p: boolean) { }} : { [Symbol.iterator]: number; [Symbol.toStringT…
20 set [Symbol.toPrimitive](p: boolean) { }
21 >[Symbol.toPrimitive] : boolean
22 >Symbol.toPrimitive : symbol
24 >toPrimitive : symbol
31 >i : { [Symbol.iterator]: number; [Symbol.toStringTag](): string; [Symbol.toPrimitive]: boolean; }
40 >i : { [Symbol.iterator]: number; [Symbol.toStringTag](): string; [Symbol.toPrimitive]: boolean; }
45 i[Symbol.toPrimitive] = false;
46 >i[Symbol.toPrimitive] = false : false
[all …]
DsymbolDeclarationEmit4.symbols5 get [Symbol.toPrimitive]() { return ""; }
6 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit4.ts, 0, 9), Decl(s…
7 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
9 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
11 set [Symbol.toPrimitive](x) { }
12 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit4.ts, 0, 9), Decl(s…
13 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
15 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
DsymbolProperty24.symbols5 [Symbol.toPrimitive]: () => boolean;
6 >[Symbol.toPrimitive] : Symbol(I[Symbol.toPrimitive], Decl(symbolProperty24.ts, 0, 13))
7 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
9 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
16 [Symbol.toPrimitive]() {
17 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolProperty24.ts, 4, 22))
18 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
20 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
DsymbolDeclarationEmit3.types5 [Symbol.toPrimitive](x: number);
6 >[Symbol.toPrimitive] : { (x: number): any; (x: string): any; }
7 >Symbol.toPrimitive : symbol
9 >toPrimitive : symbol
12 [Symbol.toPrimitive](x: string);
13 >[Symbol.toPrimitive] : { (x: number): any; (x: string): any; }
14 >Symbol.toPrimitive : symbol
16 >toPrimitive : symbol
19 [Symbol.toPrimitive](x: any) { }
20 >[Symbol.toPrimitive] : { (x: number): any; (x: string): any; }
[all …]
DsymbolProperty23.symbols5 [Symbol.toPrimitive]: () => boolean;
6 >[Symbol.toPrimitive] : Symbol(I[Symbol.toPrimitive], Decl(symbolProperty23.ts, 0, 13))
7 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
9 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
16 [Symbol.toPrimitive]() {
17 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolProperty23.ts, 4, 22))
18 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
20 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
DsymbolDeclarationEmit12.types15 [Symbol.toPrimitive](x: I) { }
16 >[Symbol.toPrimitive] : (x: I) => void
17 >Symbol.toPrimitive : symbol
19 >toPrimitive : symbol
31 get [Symbol.toPrimitive]() { return undefined; }
32 >[Symbol.toPrimitive] : any
33 >Symbol.toPrimitive : symbol
35 >toPrimitive : symbol
38 set [Symbol.toPrimitive](x: I) { }
39 >[Symbol.toPrimitive] : I
[all …]
DsymbolDeclarationEmit11.symbols17 static get [Symbol.toPrimitive]() { return ""; }
18 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit11.ts, 2, 44), Decl…
19 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
21 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
23 static set [Symbol.toPrimitive](x) { }
24 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit11.ts, 2, 44), Decl…
25 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
27 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
DsymbolDeclarationEmit12.js6 [Symbol.toPrimitive](x: I) { }
10 get [Symbol.toPrimitive]() { return undefined; }
11 set [Symbol.toPrimitive](x: I) { }
19 [Symbol.toPrimitive](x) { }
23 get [Symbol.toPrimitive]() { return undefined; }
24 set [Symbol.toPrimitive](x) { }
36 [Symbol.toPrimitive](x: I): void;
38 get [Symbol.toPrimitive](): any;
39 set [Symbol.toPrimitive](x: I);
DsymbolProperty24.types3 [Symbol.toPrimitive]: () => boolean;
4 >[Symbol.toPrimitive] : () => boolean
5 >Symbol.toPrimitive : symbol
7 >toPrimitive : symbol
13 [Symbol.toPrimitive]() {
14 >[Symbol.toPrimitive] : () => string
15 >Symbol.toPrimitive : symbol
17 >toPrimitive : symbol
DsymbolDeclarationEmit4.types5 get [Symbol.toPrimitive]() { return ""; }
6 >[Symbol.toPrimitive] : string
7 >Symbol.toPrimitive : symbol
9 >toPrimitive : symbol
12 set [Symbol.toPrimitive](x) { }
13 >[Symbol.toPrimitive] : string
14 >Symbol.toPrimitive : symbol
16 >toPrimitive : symbol
DsymbolDeclarationEmit12.errors.txt1 …Symbols/symbolDeclarationEmit12.ts(5,9): error TS2300: Duplicate identifier '[Symbol.toPrimitive]'.
2 …ymbols/symbolDeclarationEmit12.ts(9,13): error TS2300: Duplicate identifier '[Symbol.toPrimitive]'.
3 …mbols/symbolDeclarationEmit12.ts(10,13): error TS2300: Duplicate identifier '[Symbol.toPrimitive]'.
11 [Symbol.toPrimitive](x: I) { }
13 !!! error TS2300: Duplicate identifier '[Symbol.toPrimitive]'.
17 get [Symbol.toPrimitive]() { return undefined; }
19 !!! error TS2300: Duplicate identifier '[Symbol.toPrimitive]'.
20 set [Symbol.toPrimitive](x: I) { }
22 !!! error TS2300: Duplicate identifier '[Symbol.toPrimitive]'.
DsymbolProperty23.types3 [Symbol.toPrimitive]: () => boolean;
4 >[Symbol.toPrimitive] : () => boolean
5 >Symbol.toPrimitive : symbol
7 >toPrimitive : symbol
13 [Symbol.toPrimitive]() {
14 >[Symbol.toPrimitive] : () => boolean
15 >Symbol.toPrimitive : symbol
17 >toPrimitive : symbol
DsymbolDeclarationEmit11.types18 static get [Symbol.toPrimitive]() { return ""; }
19 >[Symbol.toPrimitive] : string
20 >Symbol.toPrimitive : symbol
22 >toPrimitive : symbol
25 static set [Symbol.toPrimitive](x) { }
26 >[Symbol.toPrimitive] : string
27 >Symbol.toPrimitive : symbol
29 >toPrimitive : symbol
DsymbolProperty18.symbols17 set [Symbol.toPrimitive](p: boolean) { }
18 >[Symbol.toPrimitive] : Symbol([Symbol.toPrimitive], Decl(symbolProperty18.ts, 2, 41))
19 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
21 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
39 i[Symbol.toPrimitive] = false;
41 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
43 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
DparserSymbolProperty8.symbols5 [Symbol.toPrimitive](): string
6 >[Symbol.toPrimitive] : Symbol([Symbol.toPrimitive], Decl(parserSymbolProperty8.ts, 0, 8))
7 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
9 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
DsymbolDeclarationEmit2.symbols5 [Symbol.toPrimitive] = "";
6 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit2.ts, 0, 9))
7 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
9 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
DparserSymbolProperty9.symbols5 [Symbol.toPrimitive]: string
6 >[Symbol.toPrimitive] : Symbol([Symbol.toPrimitive], Decl(parserSymbolProperty9.ts, 0, 8))
7 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
9 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
DsymbolDeclarationEmit1.symbols5 [Symbol.toPrimitive]: number;
6 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit1.ts, 0, 9))
7 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
9 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
DparserSymbolProperty5.symbols5 [Symbol.toPrimitive]: string;
6 >[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(parserSymbolProperty5.ts, 0, 9))
7 >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, …
9 >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
/third_party/jerryscript/tests/jerry/es2015/
Ddate-prototype-toprimitive.js20 var result = dateObj[Symbol.toPrimitive]("default");
22 result = dateNaN[Symbol.toPrimitive]("default");
26 result = dateObj[Symbol.toPrimitive]("number");
28 result = dateNaN[Symbol.toPrimitive]("number");
32 result = dateObj[Symbol.toPrimitive]("string");
34 result = dateNaN[Symbol.toPrimitive]("string");
39 result = dateObj[Symbol.toPrimitive](90);
47 Date.prototype[Symbol.toPrimitive].call(undefined);

123456