-
-
Notifications
You must be signed in to change notification settings - Fork 945
Open
Labels
AcceptedRFC feature request which has been accepted.RFC feature request which has been accepted.FeatureIssue or pull request for adding a new feature.Issue or pull request for adding a new feature.Good First IssueA good first issue for new contributors!A good first issue for new contributors!JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.difficulty: 1Low degree of difficulty. Should be straightforward to implement and/or resolve.Low degree of difficulty. Should be straightforward to implement and/or resolve.priority: NormalNormal priority concern or feature request.Normal priority concern or feature request.
Description
Description
This RFC proposes adding the package symbol/to-primitive.
The package should be very similar to the following existing packages:
symbol/has-instancesymbol/iteratorsymbol/async-iteratorsymbol/is-concat-spreadable
The primary difference is that the package should export Symbol.toPrimitive if it exists.
Related Issues
None.
Questions
No.
Other
When adding this package, one should do the following:
- copy one of the existing packages mentioned above
- rename the copied package
- find and replace the package name (e.g.,
has-instance=>to-primitive) - find and replace the variable name (e.g.,
HasInstanceSymbol=>ToPrimitiveSymbol) - ensure the copyright years are 2025
- update the descriptions according to the symbol's purpose (see MDN)
- update examples to reflect the symbol's purpose (see existing packages for inspiration)
- run tests, benchmarks, and examples to ensure that everything passes
- go back through and check that there are no copy-paste mistakes
Checklist
- I have read and understood the Code of Conduct.
- Searched for existing issues and pull requests.
- The issue name begins with
RFC:.
Metadata
Metadata
Assignees
Labels
AcceptedRFC feature request which has been accepted.RFC feature request which has been accepted.FeatureIssue or pull request for adding a new feature.Issue or pull request for adding a new feature.Good First IssueA good first issue for new contributors!A good first issue for new contributors!JavaScriptIssue involves or relates to JavaScript.Issue involves or relates to JavaScript.RFCRequest for comments. Feature requests and proposed changes.Request for comments. Feature requests and proposed changes.difficulty: 1Low degree of difficulty. Should be straightforward to implement and/or resolve.Low degree of difficulty. Should be straightforward to implement and/or resolve.priority: NormalNormal priority concern or feature request.Normal priority concern or feature request.