Skip to content

Commit 9239373

Browse files
authored
doc: remove remaining uses of @@wellknown syntax
PR-URL: nodejs#58413 Refs: tc39/ecma262#1314 Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tierney Cyren <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]>
1 parent 6027371 commit 9239373

File tree

3 files changed

+36
-31
lines changed

3 files changed

+36
-31
lines changed

doc/api/url.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ Returns an ES6 `Iterator` over each of the name-value pairs in the query.
10401040
Each item of the iterator is a JavaScript `Array`. The first item of the `Array`
10411041
is the `name`, the second item of the `Array` is the `value`.
10421042

1043-
Alias for [`urlSearchParams[@@iterator]()`][`urlSearchParams@@iterator()`].
1043+
Alias for [`urlSearchParams[Symbol.iterator]()`][`urlSearchParamsSymbol.iterator()`].
10441044

10451045
#### `urlSearchParams.forEach(fn[, thisArg])`
10461046

@@ -1965,7 +1965,7 @@ console.log(myURL.origin);
19651965
[`url.toJSON()`]: #urltojson
19661966
[`url.toString()`]: #urltostring
19671967
[`urlSearchParams.entries()`]: #urlsearchparamsentries
1968-
[`urlSearchParams@@iterator()`]: #urlsearchparamssymboliterator
1968+
[`urlSearchParamsSymbol.iterator()`]: #urlsearchparamssymboliterator
19691969
[converted to a string]: https://tc39.es/ecma262/#sec-tostring
19701970
[examples of parsed URLs]: https://url.spec.whatwg.org/#example-url-parsing
19711971
[host name spoofing]: https://hackerone.com/reports/678487

doc/api/util.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -973,8 +973,8 @@ The `util.inspect()` method returns a string representation of `object` that is
973973
intended for debugging. The output of `util.inspect` may change at any time
974974
and should not be depended upon programmatically. Additional `options` may be
975975
passed that alter the result.
976-
`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make
977-
an identifiable tag for an inspected value.
976+
`util.inspect()` will use the constructor's name and/or `Symbol.toStringTag`
977+
property to make an identifiable tag for an inspected value.
978978

979979
```js
980980
class Foo {
@@ -1884,7 +1884,7 @@ console.log(params.toString());
18841884

18851885
Returns an iterator over the values of each name-value pair.
18861886

1887-
### `mimeParams[@@iterator]()`
1887+
### `mimeParams[Symbol.iterator]()`
18881888

18891889
* Returns: {Iterator}
18901890

doc/contributing/primordials.md

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ This code is internally expanded into something that looks like:
161161

162162
```js
163163
{
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).
166167
// 3. Call that function.
167168
const iterator = array[Symbol.iterator]();
168169
// 1. Lookup `next` property on `iterator` (doesn't exist).
@@ -226,8 +227,9 @@ const [first, second] = array;
226227
This is roughly equivalent to:
227228

228229
```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).
231233
// 3. Call that function.
232234
const iterator = array[Symbol.iterator]();
233235
// 1. Lookup `next` property on `iterator` (doesn't exist).
@@ -262,8 +264,9 @@ best choice.
262264
<summary>Avoid spread operator on arrays</summary>
263265

264266
```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).
267270
// 3. Lookup `next` property on %ArrayIteratorPrototype% (user-mutable).
268271
const arrayCopy = [...array];
269272
func(...array);
@@ -281,17 +284,17 @@ ReflectApply(func, null, array);
281284
<details>
282285

283286
<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>
286289

287290
```js
288291
{
289292
// 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%
293296
// (user-mutable).
294-
// 2. Lookup @@isConcatSpreadable property on `%Object.prototype%
297+
// 2. Lookup %Symbol.isConcatSpreadable% property on `%Object.prototype%
295298
// (user-mutable).
296299
const array = [];
297300
ArrayPrototypeConcat(array);
@@ -340,8 +343,9 @@ Object.defineProperty(Object.prototype, Symbol.isConcatSpreadable, {
340343
```js
341344
{
342345
// 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).
345349
// 3. Lookup `next` property on %ArrayIteratorPrototype% (user-mutable).
346350
const obj = ObjectFromEntries(array);
347351
}
@@ -371,8 +375,9 @@ Object.defineProperty(Object.prototype, Symbol.isConcatSpreadable, {
371375
<code>%Promise.race%</code> iterate over an array</summary>
372376

373377
```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).
376381
// 3. Lookup `next` property on %ArrayIteratorPrototype% (user-mutable).
377382
// 4. Lookup `then` property on %Array.Prototype% (user-mutable).
378383
// 5. Lookup `then` property on %Object.Prototype% (user-mutable).
@@ -437,7 +442,7 @@ Array.prototype[Symbol.iterator] = () => ({
437442

438443
// Core
439444

440-
// 1. Lookup @@iterator property on %Array.prototype% (user-mutable).
445+
// 1. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
441446
// 2. Lookup `next` property on %ArrayIteratorPrototype% (user-mutable).
442447
const set = new SafeSet([1, 2, 3]);
443448

@@ -684,14 +689,14 @@ can be reset from user-land.
684689
<summary>List of <code>RegExp</code> methods that look up properties from
685690
mutable getters</summary>
686691

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` |
695700

696701
</details>
697702

@@ -786,7 +791,7 @@ console.log(proxyWithNullPrototypeObject.someProperty); // genuine value
786791

787792
### Checking if an object is an instance of a class
788793

789-
#### Using `instanceof` looks up the `@@hasInstance` property of the class
794+
#### Using `instanceof` looks up the `%Symbol.hasInstance%` property of the class
790795

791796
```js
792797
// User-land

0 commit comments

Comments
 (0)