-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
bootstrap: consolidate global properties definition #43357
Conversation
Review requested:
|
09634a7
to
dd593ec
Compare
dd593ec
to
ba792a8
Compare
ba792a8
to
89b291b
Compare
89b291b
to
39fbce4
Compare
lib/internal/bootstrap/node.js
Outdated
configurable: true | ||
}); | ||
|
||
// globalThis.process is been installed at `internal/bootstrap/pre_execution.js`. |
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.
// globalThis.process is been installed at `internal/bootstrap/pre_execution.js`. | |
// globalThis.process will be installed at `internal/bootstrap/pre_execution.js`. |
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.
But why are we removing these anyway? Removing these results in a breaking change for the embedders, which is why the tests have to be updated.
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 was reviewing the installation point of globalThis.process
and globalThis.Buffer
. It can be more intuitive to install them once rather than duplicate the installation.
It is true that removing can cause breaking changes on embedders with custom entry points. What do you think about moving the actual installation here?
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 think the reason that they are overriden in pre_execution is that we thought we were going to make this optional for ESM (probably behind flags), which didn't seem to happen...
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.
Yeah, that's true. From what I could tell, the current shape of the property descriptor is not going to be changed in anytime soon.
c64d580
to
39394c2
Compare
`globalThis.process` and `globalThis.Buffer` has been re-defined with a getter/setter pair. `atob` and `bota` are defined as enumerable properties according to WebIDL definition.
39394c2
to
9c4ae03
Compare
Landed in 511e289 |
`globalThis.process` and `globalThis.Buffer` has been re-defined with a getter/setter pair. `atob` and `bota` are defined as enumerable properties according to WebIDL definition. PR-URL: #43357 Refs: #26882 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
`globalThis.process` and `globalThis.Buffer` has been re-defined with a getter/setter pair. `atob` and `bota` are defined as enumerable properties according to WebIDL definition. PR-URL: #43357 Refs: #26882 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
globalThis.process
andglobalThis.Buffer
has been re-defined witha getter/setter pair.
atob
andbota
are defined as enumerable properties according toWebIDL definition.
Refs: #26882
Refs: #37786 (comment)