Skip to content

Commit 33028d5

Browse files
Replace uses of 'Symbol.isRegExp' with 'Symbol.toPrimitive'.
1 parent f75c9a6 commit 33028d5

15 files changed

+24
-24
lines changed

src/lib/es6.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ interface SymbolConstructor {
5252

5353
/**
5454
* A method that returns the default iterator for an object.Called by the semantics of the
55-
* for-of statement.
55+
* for-of statement.
5656
*/
5757
iterator: symbol;
5858

5959
/**
6060
* A method that converts an object to a corresponding primitive value.Called by the ToPrimitive
61-
* abstract operation.
61+
* abstract operation.
6262
*/
6363
toPrimitive: symbol;
6464

6565
/**
66-
* A String value that is used in the creation of the default string description of an object.
67-
* Called by the built- in method Object.prototype.toString.
66+
* A String value that is used in the creation of the default string description of an object.
67+
* Called by the built-in method Object.prototype.toString.
6868
*/
6969
toStringTag: symbol;
7070

@@ -106,7 +106,7 @@ interface ObjectConstructor {
106106
getOwnPropertySymbols(o: any): symbol[];
107107

108108
/**
109-
* Returns true if the values are the same value, false otherwise.
109+
* Returns true if the values are the same value, false otherwise.
110110
* @param value1 The first value.
111111
* @param value2 The second value.
112112
*/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@target: ES6
22
//@declaration: true
33
class C {
4-
[Symbol.isRegExp]: number;
4+
[Symbol.toPrimitive]: number;
55
}

tests/cases/conformance/es6/Symbols/symbolDeclarationEmit11.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
class C {
44
static [Symbol.iterator] = 0;
55
static [Symbol.toPrimitive]() { }
6-
static get [Symbol.isRegExp]() { return ""; }
7-
static set [Symbol.isRegExp](x) { }
6+
static get [Symbol.toPrimitive]() { return ""; }
7+
static set [Symbol.toPrimitive](x) { }
88
}

tests/cases/conformance/es6/Symbols/symbolDeclarationEmit12.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module M {
88
[Symbol.isConcatSpreadable](): I {
99
return undefined
1010
}
11-
get [Symbol.isRegExp]() { return undefined; }
12-
set [Symbol.isRegExp](x: I) { }
11+
get [Symbol.toPrimitive]() { return undefined; }
12+
set [Symbol.toPrimitive](x: I) { }
1313
}
1414
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@target: ES6
22
//@declaration: true
33
class C {
4-
get [Symbol.isRegExp]() { return ""; }
4+
get [Symbol.toPrimitive]() { return ""; }
55
set [Symbol.toStringTag](x) { }
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@target: ES6
22
//@declaration: true
33
class C {
4-
get [Symbol.isRegExp]() { return ""; }
4+
get [Symbol.toPrimitive]() { return ""; }
55
get [Symbol.toStringTag]() { return ""; }
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@target: ES6
22
//@declaration: true
33
class C {
4-
[Symbol.isRegExp] = "";
4+
[Symbol.toPrimitive] = "";
55
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@target: ES6
22
//@declaration: true
33
class C {
4-
[Symbol.isRegExp](x: number);
5-
[Symbol.isRegExp](x: string);
6-
[Symbol.isRegExp](x: any) { }
4+
[Symbol.toPrimitive](x: number);
5+
[Symbol.toPrimitive](x: string);
6+
[Symbol.toPrimitive](x: any) { }
77
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@target: ES6
22
//@declaration: true
33
class C {
4-
get [Symbol.isRegExp]() { return ""; }
5-
set [Symbol.isRegExp](x) { }
4+
get [Symbol.toPrimitive]() { return ""; }
5+
set [Symbol.toPrimitive](x) { }
66
}

tests/cases/conformance/es6/Symbols/symbolProperty21.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ declare function foo<T, U>(p: I<T, U>): { t: T; u: U };
88

99
foo({
1010
[Symbol.isConcatSpreadable]: "",
11-
[Symbol.isRegExp]: 0,
11+
[Symbol.toPrimitive]: 0,
1212
[Symbol.unscopables]: true
1313
});

0 commit comments

Comments
 (0)