@@ -161,8 +161,9 @@ This code is internally expanded into something that looks like:
161
161
162
162
```js
163
163
{
164
-
// 1. Lookup @@iterator property on `array` (user-mutable if user-provided).
165
-
// 2. Lookup @@iterator property on %Array.prototype% (user-mutable).
164
+
// 1. Lookup %Symbol.iterator% property on `array` (user-mutable if
165
+
// user-provided).
166
+
// 2. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
166
167
// 3. Call that function.
167
168
const iterator = array[Symbol.iterator]();
168
169
// 1. Lookup `next` property on `iterator` (doesn't exist).
@@ -226,8 +227,9 @@ const [first, second] = array;
226
227
This is roughly equivalent to:
227
228
228
229
```js
229
-
// 1. Lookup @@iterator property on `array` (user-mutable if user-provided).
230
-
// 2. Lookup @@iterator property on %Array.prototype% (user-mutable).
230
+
// 1. Lookup %Symbol.iterator% property on `array` (user-mutable if
231
+
// user-provided).
232
+
// 2. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
231
233
// 3. Call that function.
232
234
const iterator = array[Symbol.iterator]();
233
235
// 1. Lookup `next` property on `iterator` (doesn't exist).
@@ -262,8 +264,9 @@ best choice.
262
264
<summary>Avoid spread operator on arrays</summary>
263
265
264
266
```js
265
-
// 1. Lookup @@iterator property on `array` (user-mutable if user-provided).
266
-
// 2. Lookup @@iterator property on %Array.prototype% (user-mutable).
267
+
// 1. Lookup %Symbol.iterator% property on `array` (user-mutable if
268
+
// user-provided).
269
+
// 2. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
267
270
// 3. Lookup `next` property on %ArrayIteratorPrototype% (user-mutable).
268
271
const arrayCopy = [...array];
269
272
func(...array);
@@ -281,17 +284,17 @@ ReflectApply(func, null, array);
281
284
<details>
282
285
283
286
<summary><code>%Array.prototype.concat%</code> looks up
284
-
<code>@@isConcatSpreadable</code> property of the passed
285
-
arguments and the <code>this</code> value.</summary>
287
+
<code>%Symbol.isConcatSpreadable%</code> property of the passed
288
+
arguments and the <code>this</code> value</summary>
286
289
287
290
```js
288
291
{
289
292
// Unsafe code example:
290
-
// 1. Lookup @@isConcatSpreadable property on `array` (user-mutable if
291
-
// user-provided).
292
-
// 2. Lookup @@isConcatSpreadable property on `%Array.prototype%
293
+
// 1. Lookup %Symbol.isConcatSpreadable% property on `array`
294
+
// (user-mutable if user-provided).
295
+
// 2. Lookup %Symbol.isConcatSpreadable% property on `%Array.prototype%
293
296
// (user-mutable).
294
-
// 2. Lookup @@isConcatSpreadable property on `%Object.prototype%
297
+
// 2. Lookup %Symbol.isConcatSpreadable% property on `%Object.prototype%
295
298
// (user-mutable).
296
299
const array = [];
297
300
ArrayPrototypeConcat(array);
@@ -340,8 +343,9 @@ Object.defineProperty(Object.prototype, Symbol.isConcatSpreadable, {
340
343
```js
341
344
{
342
345
// Unsafe code example:
343
-
// 1. Lookup @@iterator property on `array` (user-mutable if user-provided).
344
-
// 2. Lookup @@iterator property on %Array.prototype% (user-mutable).
346
+
// 1. Lookup %Symbol.iterator% property on `array` (user-mutable if
347
+
// user-provided).
348
+
// 2. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
345
349
// 3. Lookup `next` property on %ArrayIteratorPrototype% (user-mutable).
346
350
const obj = ObjectFromEntries(array);
347
351
}
@@ -371,8 +375,9 @@ Object.defineProperty(Object.prototype, Symbol.isConcatSpreadable, {
371
375
<code>%Promise.race%</code> iterate over an array</summary>
372
376
373
377
```js
374
-
// 1. Lookup @@iterator property on `array` (user-mutable if user-provided).
375
-
// 2. Lookup @@iterator property on %Array.prototype% (user-mutable).
378
+
// 1. Lookup %Symbol.iterator% property on `array` (user-mutable if
379
+
// user-provided).
380
+
// 2. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
376
381
// 3. Lookup `next` property on %ArrayIteratorPrototype% (user-mutable).
377
382
// 4. Lookup `then` property on %Array.Prototype% (user-mutable).
378
383
// 5. Lookup `then` property on %Object.Prototype% (user-mutable).
@@ -437,7 +442,7 @@ Array.prototype[Symbol.iterator] = () => ({
437
442
438
443
// Core
439
444
440
-
// 1. Lookup @@iterator property on %Array.prototype% (user-mutable).
445
+
// 1. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
441
446
// 2. Lookup `next` property on %ArrayIteratorPrototype% (user-mutable).
442
447
const set = new SafeSet([1, 2, 3]);
443
448
@@ -684,14 +689,14 @@ can be reset from user-land.
684
689
<summary>List of <code>RegExp</code> methods that look up properties from
685
690
mutable getters</summary>
686
691
687
-
| `RegExp` method | looks up the following flag-related properties |
688
-
| ------------------------------ | ------------------------------------------------------------------ |
689
-
| `get RegExp.prototype.flags` | `global`, `ignoreCase`, `multiline`, `dotAll`, `unicode`, `sticky` |
690
-
| `RegExp.prototype[@@match]` | `global`, `unicode` |
691
-
| `RegExp.prototype[@@matchAll]` | `flags` |
692
-
| `RegExp.prototype[@@replace]` | `global`, `unicode` |
693
-
| `RegExp.prototype[@@split]` | `flags` |
694
-
| `RegExp.prototype.toString` | `flags` |
692
+
| `RegExp` method | looks up the following flag-related properties |
693
+
| ----------------------------------- | ------------------------------------------------------------------ |
694
+
| `get RegExp.prototype.flags` | `global`, `ignoreCase`, `multiline`, `dotAll`, `unicode`, `sticky` |
695
+
| `RegExp.prototype[Symbol.match]` | `global`, `unicode` |
696
+
| `RegExp.prototype[Symbol.matchAll]` | `flags` |
697
+
| `RegExp.prototype[Symbol.replace]` | `global`, `unicode` |
698
+
| `RegExp.prototype[Symbol.split]` | `flags` |
699
+
| `RegExp.prototype.toString` | `flags` |
695
700
696
701
</details>
697
702
@@ -786,7 +791,7 @@ console.log(proxyWithNullPrototypeObject.someProperty); // genuine value
786
791
787
792
### Checking if an object is an instance of a class
788
793
789
-
#### Using `instanceof` looks up the `@@hasInstance` property of the class
794
+
#### Using `instanceof` looks up the `%Symbol.hasInstance%` property of the class
790
795
791
796
```js
792
797
// User-land
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4