Skip to content
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

Remove all @@notation in JS prose #34817

Merged
merged 2 commits into from
Jul 13, 2024
Merged

Remove all @@notation in JS prose #34817

merged 2 commits into from
Jul 13, 2024

Conversation

Josh-Cena
Copy link
Member

Part of mdn/mdn#562. I'm sending this as one monolithic PR, because I don't think it's helpful to merge "parts" of this PR. Please review as much and as little as you want and use the incremental review features.

@Josh-Cena Josh-Cena requested a review from a team as a code owner July 12, 2024 20:29
@Josh-Cena Josh-Cena requested review from teoli2003 and removed request for a team July 12, 2024 20:29
@github-actions github-actions bot added Content:JS JavaScript docs size/l [PR only] 501-1000 LoC changed labels Jul 12, 2024
Copy link
Contributor

github-actions bot commented Jul 12, 2024

Preview URLs (133 pages)
External URLs (20)

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/@@species
Title: Promise[Symbol.species]


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/@@hasInstance
Title: Function.prototype[Symbol.hasInstance]()


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/@@species
Title: SharedArrayBuffer[Symbol.species]


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/@@species
Title: ArrayBuffer[Symbol.species]


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/String/@@iterator
Title: String.prototype[Symbol.iterator]()


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/species
Title: Symbol.species


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/unscopables
Title: Symbol.unscopables


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator
Title: Array.prototype[Symbol.iterator]()


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@species
Title: Array[Symbol.species]


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@unscopables
Title: Array.prototype[Symbol.unscopables]


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@species
Title: RegExp[Symbol.species]


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@search
Title: RegExp.prototype[Symbol.search]()


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@replace
Title: RegExp.prototype[Symbol.replace]()


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@matchAll
Title: RegExp.prototype[Symbol.matchAll]()


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match
Title: RegExp.prototype[Symbol.match]()


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@split
Title: RegExp.prototype[Symbol.split]()


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/@@iterator
Title: TypedArray.prototype[Symbol.iterator]()


URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/@@species
Title: TypedArray[Symbol.species]


URL: /en-US/docs/Web/JavaScript/Reference/Operators/Addition
Title: Addition (+)

(comment last updated: 2024-07-12 23:14:19)

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a very few questions / things to confirm.

@@ -21,7 +21,7 @@ new WeakMap(iterable)
### Parameters

- `iterable`
- : An [`Array`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) or other iterable object that implements an [@@iterator](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator) method that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined.
- : An [`Array`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) or other iterable object that implements an [Symbol.iterator](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator) method that returns an iterator object that produces a two-element array-like object whose first element is a value that will be used as a `WeakMap` key and whose second element is the value to associate with that key. Each key-value pair will be added to the new `WeakMap`. null is treated as undefined.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need a () here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch. I was search&replacing all [@@xxx]( and it managed to match this.

@@ -19,11 +19,11 @@ TypedArray[Symbol.species]

### Return value

The value of the constructor (`this`) on which `get @@species` was called. The return value is used to construct return values from typed array methods that create new typed arrays.
The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from typed array methods that create new typed arrays.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The value of the constructor (`this`) on which `get [Symbol.species]` was called. The return value is used to construct return values from typed array methods that create new typed arrays.
The value of the constructor (`this`) on which `get [Symbol.species]()` was called. The return value is used to construct return values from typed array methods that create new typed arrays.

not sure if the parens are needed. just want to be sure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No; this is not a method, but a property.

@@ -64,7 +64,7 @@ console.log(arrIter.next().value); // 50

## See also

- [Polyfill of `TypedArray.prototype[@@iterator]` in `core-js`](https://github.com/zloirock/core-js#ecmascript-typed-arrays)
- [Polyfill of `TypedArray.prototype[Symbol.iterator]` in `core-js`](https://github.com/zloirock/core-js#ecmascript-typed-arrays)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has been supported for a long time. can we remove the pollyfill?

Copy link
Member Author

@Josh-Cena Josh-Cena Jul 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No; we don't remove core-js polyfills. We have reached consensus on that since this is the least-disruptive way to make the content still useful. Polyfills are not only useful for backwards compatibility; they also fix bugs.


{{js_property_attributes(0, 0, 0)}}

## Examples

### User-defined async iterables

You can define your own async iterable by setting the `[Symbol.asyncIterator]` property on an object.
You can define your own async iterable by setting the `[Symbol.asyncIterator]()` property on an object.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure about parenthesis on this property?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This one is a method.

@Josh-Cena
Copy link
Member Author

Estelle you have great eyes 😄

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🎉

@estelle estelle merged commit 6e93ec8 into mdn:main Jul 13, 2024
8 checks passed
@Josh-Cena Josh-Cena deleted the rm-at-at-js branch July 13, 2024 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs size/l [PR only] 501-1000 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants