Rename references in es6.d.ts from Symbol to symbol
This commit is contained in:
parent
e346b70013
commit
59a704e7c1
26
src/lib/es6.d.ts
vendored
26
src/lib/es6.d.ts
vendored
|
@ -1,4 +1,4 @@
|
|||
declare type PropertyKey = string | number | Symbol;
|
||||
declare type PropertyKey = string | number | symbol;
|
||||
|
||||
interface Symbol {
|
||||
/** Returns a string representation of an object. */
|
||||
|
@ -20,21 +20,21 @@ interface SymbolConstructor {
|
|||
* Returns a new unique Symbol value.
|
||||
* @param description Description of the new Symbol object.
|
||||
*/
|
||||
(description?: string|number): Symbol;
|
||||
(description?: string|number): symbol;
|
||||
|
||||
/**
|
||||
* Returns a Symbol object from the global symbol registry matching the given key if found.
|
||||
* Otherwise, returns a new symbol with this key.
|
||||
* @param key key to search for.
|
||||
*/
|
||||
for(key: string): Symbol;
|
||||
for(key: string): symbol;
|
||||
|
||||
/**
|
||||
* Returns a key from the global symbol registry matching the given Symbol if found.
|
||||
* Otherwise, returns a undefined.
|
||||
* @param sym Symbol to find the key for.
|
||||
*/
|
||||
keyFor(sym: Symbol): string;
|
||||
keyFor(sym: symbol): string;
|
||||
|
||||
// Well-known Symbols
|
||||
|
||||
|
@ -42,42 +42,42 @@ interface SymbolConstructor {
|
|||
* A method that determines if a constructor object recognizes an object as one of the
|
||||
* constructor’s instances. Called by the semantics of the instanceof operator.
|
||||
*/
|
||||
hasInstance: Symbol;
|
||||
hasInstance: symbol;
|
||||
|
||||
/**
|
||||
* A Boolean value that if true indicates that an object should flatten to its array elements
|
||||
* by Array.prototype.concat.
|
||||
*/
|
||||
isConcatSpreadable: Symbol;
|
||||
isConcatSpreadable: symbol;
|
||||
|
||||
/**
|
||||
* A Boolean value that if true indicates that an object may be used as a regular expression.
|
||||
*/
|
||||
isRegExp: Symbol;
|
||||
isRegExp: symbol;
|
||||
|
||||
/**
|
||||
* A method that returns the default iterator for an object.Called by the semantics of the
|
||||
* for-of statement.
|
||||
*/
|
||||
iterator: Symbol;
|
||||
iterator: symbol;
|
||||
|
||||
/**
|
||||
* A method that converts an object to a corresponding primitive value.Called by the ToPrimitive
|
||||
* abstract operation.
|
||||
*/
|
||||
toPrimitive: Symbol;
|
||||
toPrimitive: symbol;
|
||||
|
||||
/**
|
||||
* A String value that is used in the creation of the default string description of an object.
|
||||
* Called by the built- in method Object.prototype.toString.
|
||||
*/
|
||||
toStringTag: Symbol;
|
||||
toStringTag: symbol;
|
||||
|
||||
/**
|
||||
* An Object whose own property names are property names that are excluded from the with
|
||||
* environment bindings of the associated objects.
|
||||
*/
|
||||
unscopables: Symbol;
|
||||
unscopables: symbol;
|
||||
}
|
||||
declare var Symbol: SymbolConstructor;
|
||||
|
||||
|
@ -108,7 +108,7 @@ interface ObjectConstructor {
|
|||
* Returns an array of all symbol properties found directly on object o.
|
||||
* @param o Object to retrieve the symbols from.
|
||||
*/
|
||||
getOwnPropertySymbols(o: any): Symbol[];
|
||||
getOwnPropertySymbols(o: any): symbol[];
|
||||
|
||||
/**
|
||||
* Returns true if the values are the same value, false otherwise.
|
||||
|
@ -3521,7 +3521,7 @@ declare var Reflect: {
|
|||
getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
||||
getPrototypeOf(target: any): any;
|
||||
has(target: any, propertyKey: string): boolean;
|
||||
has(target: any, propertyKey: Symbol): boolean;
|
||||
has(target: any, propertyKey: symbol): boolean;
|
||||
isExtensible(target: any): boolean;
|
||||
ownKeys(target: any): Array<PropertyKey>;
|
||||
preventExtensions(target: any): boolean;
|
||||
|
|
|
@ -1029,8 +1029,9 @@ declare module "typescript" {
|
|||
ObjectLiteral = 131072,
|
||||
ContainsUndefinedOrNull = 262144,
|
||||
ContainsObjectLiteral = 524288,
|
||||
Intrinsic = 127,
|
||||
Primitive = 510,
|
||||
ESSymbol = 1048576,
|
||||
Intrinsic = 1048703,
|
||||
Primitive = 1049086,
|
||||
StringLike = 258,
|
||||
NumberLike = 132,
|
||||
ObjectType = 48128,
|
||||
|
|
|
@ -3314,10 +3314,13 @@ declare module "typescript" {
|
|||
ContainsObjectLiteral = 524288,
|
||||
>ContainsObjectLiteral : TypeFlags
|
||||
|
||||
Intrinsic = 127,
|
||||
ESSymbol = 1048576,
|
||||
>ESSymbol : TypeFlags
|
||||
|
||||
Intrinsic = 1048703,
|
||||
>Intrinsic : TypeFlags
|
||||
|
||||
Primitive = 510,
|
||||
Primitive = 1049086,
|
||||
>Primitive : TypeFlags
|
||||
|
||||
StringLike = 258,
|
||||
|
|
|
@ -1060,8 +1060,9 @@ declare module "typescript" {
|
|||
ObjectLiteral = 131072,
|
||||
ContainsUndefinedOrNull = 262144,
|
||||
ContainsObjectLiteral = 524288,
|
||||
Intrinsic = 127,
|
||||
Primitive = 510,
|
||||
ESSymbol = 1048576,
|
||||
Intrinsic = 1048703,
|
||||
Primitive = 1049086,
|
||||
StringLike = 258,
|
||||
NumberLike = 132,
|
||||
ObjectType = 48128,
|
||||
|
|
|
@ -3458,10 +3458,13 @@ declare module "typescript" {
|
|||
ContainsObjectLiteral = 524288,
|
||||
>ContainsObjectLiteral : TypeFlags
|
||||
|
||||
Intrinsic = 127,
|
||||
ESSymbol = 1048576,
|
||||
>ESSymbol : TypeFlags
|
||||
|
||||
Intrinsic = 1048703,
|
||||
>Intrinsic : TypeFlags
|
||||
|
||||
Primitive = 510,
|
||||
Primitive = 1049086,
|
||||
>Primitive : TypeFlags
|
||||
|
||||
StringLike = 258,
|
||||
|
|
|
@ -1061,8 +1061,9 @@ declare module "typescript" {
|
|||
ObjectLiteral = 131072,
|
||||
ContainsUndefinedOrNull = 262144,
|
||||
ContainsObjectLiteral = 524288,
|
||||
Intrinsic = 127,
|
||||
Primitive = 510,
|
||||
ESSymbol = 1048576,
|
||||
Intrinsic = 1048703,
|
||||
Primitive = 1049086,
|
||||
StringLike = 258,
|
||||
NumberLike = 132,
|
||||
ObjectType = 48128,
|
||||
|
|
|
@ -3410,10 +3410,13 @@ declare module "typescript" {
|
|||
ContainsObjectLiteral = 524288,
|
||||
>ContainsObjectLiteral : TypeFlags
|
||||
|
||||
Intrinsic = 127,
|
||||
ESSymbol = 1048576,
|
||||
>ESSymbol : TypeFlags
|
||||
|
||||
Intrinsic = 1048703,
|
||||
>Intrinsic : TypeFlags
|
||||
|
||||
Primitive = 510,
|
||||
Primitive = 1049086,
|
||||
>Primitive : TypeFlags
|
||||
|
||||
StringLike = 258,
|
||||
|
|
|
@ -1098,8 +1098,9 @@ declare module "typescript" {
|
|||
ObjectLiteral = 131072,
|
||||
ContainsUndefinedOrNull = 262144,
|
||||
ContainsObjectLiteral = 524288,
|
||||
Intrinsic = 127,
|
||||
Primitive = 510,
|
||||
ESSymbol = 1048576,
|
||||
Intrinsic = 1048703,
|
||||
Primitive = 1049086,
|
||||
StringLike = 258,
|
||||
NumberLike = 132,
|
||||
ObjectType = 48128,
|
||||
|
|
|
@ -3583,10 +3583,13 @@ declare module "typescript" {
|
|||
ContainsObjectLiteral = 524288,
|
||||
>ContainsObjectLiteral : TypeFlags
|
||||
|
||||
Intrinsic = 127,
|
||||
ESSymbol = 1048576,
|
||||
>ESSymbol : TypeFlags
|
||||
|
||||
Intrinsic = 1048703,
|
||||
>Intrinsic : TypeFlags
|
||||
|
||||
Primitive = 510,
|
||||
Primitive = 1049086,
|
||||
>Primitive : TypeFlags
|
||||
|
||||
StringLike = 258,
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
interface I {
|
||||
>I : I
|
||||
|
||||
[s: Symbol]: string;
|
||||
>s : Symbol
|
||||
>Symbol : Symbol
|
||||
[s: symbol]: string;
|
||||
>s : symbol
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
class C {
|
||||
>C : C
|
||||
|
||||
[s: Symbol]: string;
|
||||
>s : Symbol
|
||||
>Symbol : Symbol
|
||||
[s: symbol]: string;
|
||||
>s : symbol
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
var x: {
|
||||
>x : {}
|
||||
|
||||
[s: Symbol]: string;
|
||||
>s : Symbol
|
||||
>Symbol : Symbol
|
||||
[s: symbol]: string;
|
||||
>s : symbol
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ interface I {
|
|||
>I : I
|
||||
|
||||
[Symbol.iterator]: string;
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ interface I {
|
|||
>I : I
|
||||
|
||||
[Symbol.unscopables](): string;
|
||||
>Symbol.unscopables : Symbol
|
||||
>Symbol.unscopables : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>unscopables : Symbol
|
||||
>unscopables : symbol
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ declare class C {
|
|||
>C : C
|
||||
|
||||
[Symbol.unscopables](): string;
|
||||
>Symbol.unscopables : Symbol
|
||||
>Symbol.unscopables : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>unscopables : Symbol
|
||||
>unscopables : symbol
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ declare class C {
|
|||
>C : C
|
||||
|
||||
[Symbol.isRegExp]: string;
|
||||
>Symbol.isRegExp : Symbol
|
||||
>Symbol.isRegExp : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isRegExp : Symbol
|
||||
>isRegExp : symbol
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ class C {
|
|||
>C : C
|
||||
|
||||
[Symbol.isRegExp]: string;
|
||||
>Symbol.isRegExp : Symbol
|
||||
>Symbol.isRegExp : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isRegExp : Symbol
|
||||
>isRegExp : symbol
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ class C {
|
|||
>C : C
|
||||
|
||||
[Symbol.toStringTag]: string = "";
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ class C {
|
|||
>C : C
|
||||
|
||||
[Symbol.toStringTag](): void { }
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ var x: {
|
|||
>x : { [Symbol.toPrimitive](): string; }
|
||||
|
||||
[Symbol.toPrimitive](): string
|
||||
>Symbol.toPrimitive : Symbol
|
||||
>Symbol.toPrimitive : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toPrimitive : Symbol
|
||||
>toPrimitive : symbol
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ var x: {
|
|||
>x : { [Symbol.toPrimitive]: string; }
|
||||
|
||||
[Symbol.toPrimitive]: string
|
||||
>Symbol.toPrimitive : Symbol
|
||||
>Symbol.toPrimitive : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toPrimitive : Symbol
|
||||
>toPrimitive : symbol
|
||||
}
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
=== tests/cases/conformance/es6/Symbols/symbolProperty1.ts ===
|
||||
var s: Symbol;
|
||||
>s : Symbol
|
||||
>Symbol : Symbol
|
||||
var s: symbol;
|
||||
>s : symbol
|
||||
|
||||
var x = {
|
||||
>x : {}
|
||||
>{ [s]: 0, [s]() { }, get [s]() { return 0; }} : {}
|
||||
|
||||
[s]: 0,
|
||||
>s : Symbol
|
||||
>s : symbol
|
||||
|
||||
[s]() { },
|
||||
>s : Symbol
|
||||
>s : symbol
|
||||
|
||||
get [s]() {
|
||||
>s : Symbol
|
||||
>s : symbol
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@ interface I {
|
|||
>I : I
|
||||
|
||||
[Symbol.iterator]?: { x };
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
>x : any
|
||||
}
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ class C {
|
|||
>C : C
|
||||
|
||||
[Symbol.iterator]: { x; y };
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
>x : any
|
||||
>y : any
|
||||
}
|
||||
|
@ -13,9 +13,9 @@ interface I {
|
|||
>I : I
|
||||
|
||||
[Symbol.iterator]: { x };
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
>x : any
|
||||
}
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ class C {
|
|||
>C : C
|
||||
|
||||
[Symbol.iterator]: { x; y };
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
>x : any
|
||||
>y : any
|
||||
}
|
||||
|
@ -13,9 +13,9 @@ interface I {
|
|||
>I : I
|
||||
|
||||
[Symbol.iterator]?: { x };
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
>x : any
|
||||
}
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ interface I {
|
|||
>I : I
|
||||
|
||||
[Symbol.iterator]?: { x };
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
>x : any
|
||||
}
|
||||
|
||||
|
|
|
@ -3,18 +3,18 @@ class C {
|
|||
>C : C
|
||||
|
||||
private [Symbol.iterator]: { x };
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
>x : any
|
||||
}
|
||||
interface I {
|
||||
>I : I
|
||||
|
||||
[Symbol.iterator]: { x };
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
>x : any
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
=== tests/cases/conformance/es6/Symbols/symbolProperty2.ts ===
|
||||
var s = Symbol();
|
||||
>s : Symbol
|
||||
>Symbol() : Symbol
|
||||
>s : symbol
|
||||
>Symbol() : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
|
||||
var x = {
|
||||
|
@ -9,13 +9,13 @@ var x = {
|
|||
>{ [s]: 0, [s]() { }, get [s]() { return 0; }} : {}
|
||||
|
||||
[s]: 0,
|
||||
>s : Symbol
|
||||
>s : symbol
|
||||
|
||||
[s]() { },
|
||||
>s : Symbol
|
||||
>s : symbol
|
||||
|
||||
get [s]() {
|
||||
>s : Symbol
|
||||
>s : symbol
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -3,15 +3,15 @@ interface I {
|
|||
>I : I
|
||||
|
||||
[Symbol.iterator]: (s: string) => string;
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
>s : string
|
||||
|
||||
[Symbol.toStringTag](s: number): number;
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
>s : number
|
||||
}
|
||||
|
||||
|
@ -21,17 +21,17 @@ var i: I = {
|
|||
>{ [Symbol.iterator]: s => s, [Symbol.toStringTag](n) { return n; }} : { [Symbol.iterator]: (s: string) => string; [Symbol.toStringTag](n: number): number; }
|
||||
|
||||
[Symbol.iterator]: s => s,
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
>s => s : (s: string) => string
|
||||
>s : string
|
||||
>s : string
|
||||
|
||||
[Symbol.toStringTag](n) { return n; }
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
>n : number
|
||||
>n : number
|
||||
}
|
||||
|
|
|
@ -5,15 +5,15 @@ interface I<T, U> {
|
|||
>U : U
|
||||
|
||||
[Symbol.unscopables]: T;
|
||||
>Symbol.unscopables : Symbol
|
||||
>Symbol.unscopables : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>unscopables : Symbol
|
||||
>unscopables : symbol
|
||||
>T : T
|
||||
|
||||
[Symbol.isConcatSpreadable]: U;
|
||||
>Symbol.isConcatSpreadable : Symbol
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : Symbol
|
||||
>isConcatSpreadable : symbol
|
||||
>U : U
|
||||
}
|
||||
|
||||
|
@ -36,18 +36,18 @@ foo({
|
|||
>{ [Symbol.isConcatSpreadable]: "", [Symbol.isRegExp]: 0, [Symbol.unscopables]: true} : { [Symbol.isConcatSpreadable]: string; [Symbol.isRegExp]: number; [Symbol.unscopables]: boolean; }
|
||||
|
||||
[Symbol.isConcatSpreadable]: "",
|
||||
>Symbol.isConcatSpreadable : Symbol
|
||||
>Symbol.isConcatSpreadable : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isConcatSpreadable : Symbol
|
||||
>isConcatSpreadable : symbol
|
||||
|
||||
[Symbol.isRegExp]: 0,
|
||||
>Symbol.isRegExp : Symbol
|
||||
>Symbol.isRegExp : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isRegExp : Symbol
|
||||
>isRegExp : symbol
|
||||
|
||||
[Symbol.unscopables]: true
|
||||
>Symbol.unscopables : Symbol
|
||||
>Symbol.unscopables : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>unscopables : Symbol
|
||||
>unscopables : symbol
|
||||
|
||||
});
|
||||
|
|
|
@ -5,9 +5,9 @@ interface I<T, U> {
|
|||
>U : U
|
||||
|
||||
[Symbol.unscopables](x: T): U;
|
||||
>Symbol.unscopables : Symbol
|
||||
>Symbol.unscopables : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>unscopables : Symbol
|
||||
>unscopables : symbol
|
||||
>x : T
|
||||
>T : T
|
||||
>U : U
|
||||
|
@ -29,9 +29,9 @@ foo("", { [Symbol.unscopables]: s => s.length });
|
|||
>foo("", { [Symbol.unscopables]: s => s.length }) : number
|
||||
>foo : <T, U>(p1: T, p2: I<T, U>) => U
|
||||
>{ [Symbol.unscopables]: s => s.length } : { [Symbol.unscopables]: (s: string) => number; }
|
||||
>Symbol.unscopables : Symbol
|
||||
>Symbol.unscopables : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>unscopables : Symbol
|
||||
>unscopables : symbol
|
||||
>s => s.length : (s: string) => number
|
||||
>s : string
|
||||
>s.length : number
|
||||
|
|
|
@ -3,9 +3,9 @@ interface I {
|
|||
>I : I
|
||||
|
||||
[Symbol.toPrimitive]: () => boolean;
|
||||
>Symbol.toPrimitive : Symbol
|
||||
>Symbol.toPrimitive : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toPrimitive : Symbol
|
||||
>toPrimitive : symbol
|
||||
}
|
||||
|
||||
class C implements I {
|
||||
|
@ -13,9 +13,9 @@ class C implements I {
|
|||
>I : I
|
||||
|
||||
[Symbol.toPrimitive]() {
|
||||
>Symbol.toPrimitive : Symbol
|
||||
>Symbol.toPrimitive : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toPrimitive : Symbol
|
||||
>toPrimitive : symbol
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@ class C1 {
|
|||
>C1 : C1
|
||||
|
||||
[Symbol.toStringTag]() {
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
|
||||
return "";
|
||||
}
|
||||
|
@ -16,9 +16,9 @@ class C2 extends C1 {
|
|||
>C1 : C1
|
||||
|
||||
[Symbol.toStringTag]() {
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@ class C1 {
|
|||
>C1 : C1
|
||||
|
||||
[Symbol.toStringTag]() {
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
|
||||
return {};
|
||||
>{} : {}
|
||||
|
@ -17,9 +17,9 @@ class C2 extends C1 {
|
|||
>C1 : C1
|
||||
|
||||
[Symbol.toStringTag]() {
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -3,16 +3,15 @@ class C1 {
|
|||
>C1 : C1
|
||||
|
||||
[Symbol.toStringTag]() {
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
|
||||
return { x: "" };
|
||||
>{ x: "" } : { x: string; }
|
||||
>x : string
|
||||
}
|
||||
[s: Symbol]: () => { x: string };
|
||||
>s : Symbol
|
||||
>Symbol : Symbol
|
||||
[s: symbol]: () => { x: string };
|
||||
>s : symbol
|
||||
>x : string
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@ class C1 {
|
|||
>C1 : C1
|
||||
|
||||
[Symbol.toStringTag]() {
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
|
||||
return { x: "" };
|
||||
>{ x: "" } : { x: string; }
|
||||
|
@ -16,8 +16,7 @@ class C2 extends C1 {
|
|||
>C2 : C2
|
||||
>C1 : C1
|
||||
|
||||
[s: Symbol]: () => { x: string };
|
||||
>s : Symbol
|
||||
>Symbol : Symbol
|
||||
[s: symbol]: () => { x: string };
|
||||
>s : symbol
|
||||
>x : string
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ class C1 extends C2 {
|
|||
>C2 : C2
|
||||
|
||||
[Symbol.toStringTag]() {
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
|
||||
return { x: "" };
|
||||
>{ x: "" } : { x: string; }
|
||||
|
@ -16,8 +16,7 @@ class C1 extends C2 {
|
|||
class C2 {
|
||||
>C2 : C2
|
||||
|
||||
[s: Symbol]: () => { x: string };
|
||||
>s : Symbol
|
||||
>Symbol : Symbol
|
||||
[s: symbol]: () => { x: string };
|
||||
>s : symbol
|
||||
>x : string
|
||||
}
|
||||
|
|
|
@ -4,15 +4,15 @@ var x = {
|
|||
>{ [Symbol()]: 0, [Symbol()]() { }, get [Symbol()]() { return 0; }} : {}
|
||||
|
||||
[Symbol()]: 0,
|
||||
>Symbol() : Symbol
|
||||
>Symbol() : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
|
||||
[Symbol()]() { },
|
||||
>Symbol() : Symbol
|
||||
>Symbol() : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
|
||||
get [Symbol()]() {
|
||||
>Symbol() : Symbol
|
||||
>Symbol() : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -3,16 +3,16 @@ class C {
|
|||
>C : C
|
||||
|
||||
get [Symbol.hasInstance]() {
|
||||
>Symbol.hasInstance : Symbol
|
||||
>Symbol.hasInstance : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>hasInstance : Symbol
|
||||
>hasInstance : symbol
|
||||
|
||||
return "";
|
||||
}
|
||||
get [Symbol.toPrimitive]() {
|
||||
>Symbol.toPrimitive : Symbol
|
||||
>Symbol.toPrimitive : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toPrimitive : Symbol
|
||||
>toPrimitive : symbol
|
||||
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -4,19 +4,19 @@ var x = {
|
|||
>{ [Symbol.iterator]: 0, [Symbol.isRegExp]() { }, get [Symbol.toStringTag]() { return 0; }} : { [Symbol.iterator]: number; [Symbol.isRegExp](): void; [Symbol.toStringTag]: number; }
|
||||
|
||||
[Symbol.iterator]: 0,
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
|
||||
[Symbol.isRegExp]() { },
|
||||
>Symbol.isRegExp : Symbol
|
||||
>Symbol.isRegExp : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isRegExp : Symbol
|
||||
>isRegExp : symbol
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ module M {
|
|||
>C : C
|
||||
|
||||
[Symbol.iterator]() { }
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ module M {
|
|||
>C : C
|
||||
|
||||
[Symbol.iterator]() { }
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,24 +3,24 @@ class C {
|
|||
>C : C
|
||||
|
||||
[Symbol.iterator] = 0;
|
||||
>Symbol.iterator : Symbol
|
||||
>Symbol.iterator : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>iterator : Symbol
|
||||
>iterator : symbol
|
||||
|
||||
[Symbol.unscopables]: number;
|
||||
>Symbol.unscopables : Symbol
|
||||
>Symbol.unscopables : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>unscopables : Symbol
|
||||
>unscopables : symbol
|
||||
|
||||
[Symbol.isRegExp]() { }
|
||||
>Symbol.isRegExp : Symbol
|
||||
>Symbol.isRegExp : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isRegExp : Symbol
|
||||
>isRegExp : symbol
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
>Symbol.toStringTag : Symbol
|
||||
>Symbol.toStringTag : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>toStringTag : Symbol
|
||||
>toStringTag : symbol
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@ interface I {
|
|||
>I : I
|
||||
|
||||
[Symbol.unscopables]: number;
|
||||
>Symbol.unscopables : Symbol
|
||||
>Symbol.unscopables : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>unscopables : Symbol
|
||||
>unscopables : symbol
|
||||
|
||||
[Symbol.isRegExp]();
|
||||
>Symbol.isRegExp : Symbol
|
||||
>Symbol.isRegExp : symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>isRegExp : Symbol
|
||||
>isRegExp : symbol
|
||||
}
|
||||
|
|
24
tests/baselines/reference/symbolType9.errors.txt
Normal file
24
tests/baselines/reference/symbolType9.errors.txt
Normal file
|
@ -0,0 +1,24 @@
|
|||
tests/cases/conformance/es6/Symbols/symbolType9.ts(3,1): error TS2365: Operator '==' cannot be applied to types 'symbol' and 'boolean'.
|
||||
tests/cases/conformance/es6/Symbols/symbolType9.ts(5,1): error TS2365: Operator '!=' cannot be applied to types 'number' and 'symbol'.
|
||||
tests/cases/conformance/es6/Symbols/symbolType9.ts(7,1): error TS2365: Operator '===' cannot be applied to types 'symbol' and 'number'.
|
||||
tests/cases/conformance/es6/Symbols/symbolType9.ts(9,1): error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'symbol'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/Symbols/symbolType9.ts (4 errors) ====
|
||||
var s = Symbol.for("equal");
|
||||
s == s;
|
||||
s == true;
|
||||
~~~~~~~~~
|
||||
!!! error TS2365: Operator '==' cannot be applied to types 'symbol' and 'boolean'.
|
||||
s != s;
|
||||
0 != s;
|
||||
~~~~~~
|
||||
!!! error TS2365: Operator '!=' cannot be applied to types 'number' and 'symbol'.
|
||||
s === s;
|
||||
s === 1;
|
||||
~~~~~~~
|
||||
!!! error TS2365: Operator '===' cannot be applied to types 'symbol' and 'number'.
|
||||
s !== s;
|
||||
false !== s;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2365: Operator '!==' cannot be applied to types 'boolean' and 'symbol'.
|
|
@ -1,44 +0,0 @@
|
|||
=== tests/cases/conformance/es6/Symbols/symbolType9.ts ===
|
||||
var s = Symbol.for("equal");
|
||||
>s : Symbol
|
||||
>Symbol.for("equal") : Symbol
|
||||
>Symbol.for : (key: string) => Symbol
|
||||
>Symbol : SymbolConstructor
|
||||
>for : (key: string) => Symbol
|
||||
|
||||
s == s;
|
||||
>s == s : boolean
|
||||
>s : Symbol
|
||||
>s : Symbol
|
||||
|
||||
s == true;
|
||||
>s == true : boolean
|
||||
>s : Symbol
|
||||
|
||||
s != s;
|
||||
>s != s : boolean
|
||||
>s : Symbol
|
||||
>s : Symbol
|
||||
|
||||
0 != s;
|
||||
>0 != s : boolean
|
||||
>s : Symbol
|
||||
|
||||
s === s;
|
||||
>s === s : boolean
|
||||
>s : Symbol
|
||||
>s : Symbol
|
||||
|
||||
s === 1;
|
||||
>s === 1 : boolean
|
||||
>s : Symbol
|
||||
|
||||
s !== s;
|
||||
>s !== s : boolean
|
||||
>s : Symbol
|
||||
>s : Symbol
|
||||
|
||||
false !== s;
|
||||
>false !== s : boolean
|
||||
>s : Symbol
|
||||
|
Loading…
Reference in a new issue