Skip to content

doc: remove remaining uses of @@wellknown syntax #58413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/api/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ Returns an ES6 `Iterator` over each of the name-value pairs in the query.
Each item of the iterator is a JavaScript `Array`. The first item of the `Array`
is the `name`, the second item of the `Array` is the `value`.

Alias for [`urlSearchParams[@@iterator]()`][`urlSearchParams@@iterator()`].
Alias for [`urlSearchParams[Symbol.iterator]()`][`urlSearchParamsSymbol.iterator()`].

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

Expand Down Expand Up @@ -1965,7 +1965,7 @@ console.log(myURL.origin);
[`url.toJSON()`]: #urltojson
[`url.toString()`]: #urltostring
[`urlSearchParams.entries()`]: #urlsearchparamsentries
[`urlSearchParams@@iterator()`]: #urlsearchparamssymboliterator
[`urlSearchParamsSymbol.iterator()`]: #urlsearchparamssymboliterator
[converted to a string]: https://tc39.es/ecma262/#sec-tostring
[examples of parsed URLs]: https://url.spec.whatwg.org/#example-url-parsing
[host name spoofing]: https://hackerone.com/reports/678487
Expand Down
6 changes: 3 additions & 3 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -973,8 +973,8 @@ The `util.inspect()` method returns a string representation of `object` that is
intended for debugging. The output of `util.inspect` may change at any time
and should not be depended upon programmatically. Additional `options` may be
passed that alter the result.
`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make
an identifiable tag for an inspected value.
`util.inspect()` will use the constructor's name and/or `Symbol.toStringTag`
property to make an identifiable tag for an inspected value.

```js
class Foo {
Expand Down Expand Up @@ -1884,7 +1884,7 @@ console.log(params.toString());

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

### `mimeParams[@@iterator]()`
### `mimeParams[Symbol.iterator]()`

* Returns: {Iterator}

Expand Down
57 changes: 31 additions & 26 deletions doc/contributing/primordials.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ This code is internally expanded into something that looks like:

```js
{
// 1. Lookup @@iterator property on `array` (user-mutable if user-provided).
// 2. Lookup @@iterator property on %Array.prototype% (user-mutable).
// 1. Lookup %Symbol.iterator% property on `array` (user-mutable if
// user-provided).
// 2. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
// 3. Call that function.
const iterator = array[Symbol.iterator]();
// 1. Lookup `next` property on `iterator` (doesn't exist).
Expand Down Expand Up @@ -226,8 +227,9 @@ const [first, second] = array;
This is roughly equivalent to:

```js
// 1. Lookup @@iterator property on `array` (user-mutable if user-provided).
// 2. Lookup @@iterator property on %Array.prototype% (user-mutable).
// 1. Lookup %Symbol.iterator% property on `array` (user-mutable if
// user-provided).
// 2. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
// 3. Call that function.
const iterator = array[Symbol.iterator]();
// 1. Lookup `next` property on `iterator` (doesn't exist).
Expand Down Expand Up @@ -262,8 +264,9 @@ best choice.
<summary>Avoid spread operator on arrays</summary>

```js
// 1. Lookup @@iterator property on `array` (user-mutable if user-provided).
// 2. Lookup @@iterator property on %Array.prototype% (user-mutable).
// 1. Lookup %Symbol.iterator% property on `array` (user-mutable if
// user-provided).
// 2. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
// 3. Lookup `next` property on %ArrayIteratorPrototype% (user-mutable).
const arrayCopy = [...array];
func(...array);
Expand All @@ -281,17 +284,17 @@ ReflectApply(func, null, array);
<details>

<summary><code>%Array.prototype.concat%</code> looks up
<code>@@isConcatSpreadable</code> property of the passed
arguments and the <code>this</code> value.</summary>
<code>%Symbol.isConcatSpreadable%</code> property of the passed
arguments and the <code>this</code> value</summary>

```js
{
// Unsafe code example:
// 1. Lookup @@isConcatSpreadable property on `array` (user-mutable if
// user-provided).
// 2. Lookup @@isConcatSpreadable property on `%Array.prototype%
// 1. Lookup %Symbol.isConcatSpreadable% property on `array`
// (user-mutable if user-provided).
// 2. Lookup %Symbol.isConcatSpreadable% property on `%Array.prototype%
// (user-mutable).
// 2. Lookup @@isConcatSpreadable property on `%Object.prototype%
// 2. Lookup %Symbol.isConcatSpreadable% property on `%Object.prototype%
// (user-mutable).
const array = [];
ArrayPrototypeConcat(array);
Expand Down Expand Up @@ -340,8 +343,9 @@ Object.defineProperty(Object.prototype, Symbol.isConcatSpreadable, {
```js
{
// Unsafe code example:
// 1. Lookup @@iterator property on `array` (user-mutable if user-provided).
// 2. Lookup @@iterator property on %Array.prototype% (user-mutable).
// 1. Lookup %Symbol.iterator% property on `array` (user-mutable if
// user-provided).
// 2. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
// 3. Lookup `next` property on %ArrayIteratorPrototype% (user-mutable).
const obj = ObjectFromEntries(array);
}
Expand Down Expand Up @@ -371,8 +375,9 @@ Object.defineProperty(Object.prototype, Symbol.isConcatSpreadable, {
<code>%Promise.race%</code> iterate over an array</summary>

```js
// 1. Lookup @@iterator property on `array` (user-mutable if user-provided).
// 2. Lookup @@iterator property on %Array.prototype% (user-mutable).
// 1. Lookup %Symbol.iterator% property on `array` (user-mutable if
// user-provided).
// 2. Lookup %Symbol.iterator% property on %Array.prototype% (user-mutable).
// 3. Lookup `next` property on %ArrayIteratorPrototype% (user-mutable).
// 4. Lookup `then` property on %Array.Prototype% (user-mutable).
// 5. Lookup `then` property on %Object.Prototype% (user-mutable).
Expand Down Expand Up @@ -437,7 +442,7 @@ Array.prototype[Symbol.iterator] = () => ({

// Core

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

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

| `RegExp` method | looks up the following flag-related properties |
| ------------------------------ | ------------------------------------------------------------------ |
| `get RegExp.prototype.flags` | `global`, `ignoreCase`, `multiline`, `dotAll`, `unicode`, `sticky` |
| `RegExp.prototype[@@match]` | `global`, `unicode` |
| `RegExp.prototype[@@matchAll]` | `flags` |
| `RegExp.prototype[@@replace]` | `global`, `unicode` |
| `RegExp.prototype[@@split]` | `flags` |
| `RegExp.prototype.toString` | `flags` |
| `RegExp` method | looks up the following flag-related properties |
| ----------------------------------- | ------------------------------------------------------------------ |
| `get RegExp.prototype.flags` | `global`, `ignoreCase`, `multiline`, `dotAll`, `unicode`, `sticky` |
| `RegExp.prototype[Symbol.match]` | `global`, `unicode` |
| `RegExp.prototype[Symbol.matchAll]` | `flags` |
| `RegExp.prototype[Symbol.replace]` | `global`, `unicode` |
| `RegExp.prototype[Symbol.split]` | `flags` |
| `RegExp.prototype.toString` | `flags` |

</details>

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

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

#### Using `instanceof` looks up the `@@hasInstance` property of the class
#### Using `instanceof` looks up the `%Symbol.hasInstance%` property of the class

```js
// User-land
Expand Down
Loading