-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
doc: add primordials guidelines #38635
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
88ef6ed
doc: add primordials guidelines
aduh95 803b5e7
fixup! doc: add primordials guidelines
aduh95 a15d590
fixup! doc: add primordials guidelines
aduh95 b13a588
fixup! doc: add primordials guidelines
aduh95 f4b65b2
fixup! doc: add primordials guidelines
aduh95 e6c4f5d
fixup! doc: add primordials guidelines
aduh95 0d25b2c
fixup! doc: add primordials guidelines
aduh95 9db0b97
fixup! doc: add primordials guidelines
aduh95 ba76d73
fixup! doc: add primordials guidelines
aduh95 5b93317
fixup! fixup! doc: add primordials guidelines
aduh95 3ee715c
fixup! fixup! doc: add primordials guidelines
aduh95 1632f2b
fixup! doc: add primordials guidelines
aduh95 19e6562
fixup! doc: add primordials guidelines
aduh95 dc30f68
fixup! fixup! doc: add primordials guidelines
aduh95 4527e4b
fixup! fixup! doc: add primordials guidelines
aduh95 34de399
fixup! doc: add primordials guidelines
aduh95 5b9f680
fixup! doc: add primordials guidelines
aduh95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,254 @@ | ||||||||||
| # Usage of primordials in core | ||||||||||
|
|
||||||||||
| The file `lib/internal/per_context/primordials.js` subclasses and stores the JS | ||||||||||
| builtins that come from the VM so that Node.js builtin modules do not need to | ||||||||||
| later look these up from the global proxy, which can be mutated by users. | ||||||||||
|
|
||||||||||
| Usage of primordials should be preferred for any new code, but replacing current | ||||||||||
| code with primordials should be done with care. | ||||||||||
|
|
||||||||||
| ## How to access primordials | ||||||||||
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| The primordials is meant for internal use only, and is only accessible for | ||||||||||
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
| internal core modules. User-code cannot use or rely on primordials, it usually | ||||||||||
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
| fine to rely on ECMAScript built-ins and assume that it will behave as specd. | ||||||||||
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
|
|
||||||||||
| If you'd like to access the `primordials` object to help you on the Node.js | ||||||||||
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||||||
| development or for tinkering, you can make it globally available: | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| node --expose-internals -r internal/test/binding | ||||||||||
|
||||||||||
| ```bash | |
| node --expose-internals -r internal/test/binding | |
| ```console | |
| $ node --expose-internals -r internal/test/binding |
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this sentence is necessary. I would expect people reading this would already know what prototype methods are.
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
RaisinTen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
RaisinTen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
aduh95 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.