-
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: polyfill Symbol.dispose/Symbol.asyncDispose with correct descriptor #48703
Conversation
c379eaa
to
c08632c
Compare
d8e640c
to
c70ae63
Compare
I'm assuming this Mac OS test is flaky since it timed out - could someone rerun that one if needed? |
@@ -128,9 +128,26 @@ function prepareExecution(options) { | |||
function setupSymbolDisposePolyfill() { | |||
// TODO(MoLow): Remove this polyfill once Symbol.dispose and Symbol.asyncDispose are available in V8. | |||
// eslint-disable-next-line node-core/prefer-primordials | |||
Symbol.dispose ??= SymbolDispose; | |||
if (typeof Symbol.dispose !== 'symbol') { |
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.
We're guaranteed this runs before any userland code right?
(Just making sure this is safe since it's weird we set up Symbol.dispose here (if someone tampered with symbol they can set up a getter that throws here) but we use ObjectDefineProperty which is a primordial that guards against this sort of tampering))
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 assuming that the file called “pre execution” runs before any userland code - if not, this polyfill is highly problematic conceptually :-)
Are these 3 failing tests something I need to address? |
seems like a fluke, I reran the tests |
@MoLow still failing; are they flaky or do i need to look into it? |
passed now |
Landed in c2c7260 |
Followup to nodejs#48518; fixes nodejs#48699 PR-URL: nodejs#48703 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Followup to nodejs#48518; fixes nodejs#48699 PR-URL: nodejs#48703 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit does not land cleanly on |
@ruyadorno node 18 doesn't seem to have Symbol.dispose polyfilled, so i think this PR should have "do not backport" to <= 18? |
node 18.18 was released today with the symbols, so maybe? |
oof, ok then perhaps it will indeed backport cleanly into 18.18 :-) |
Followup to #48518; fixes #48699 PR-URL: nodejs/node#48703 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Followup to #48518; fixes #48699 PR-URL: nodejs/node#48703 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Nitzan Uziely <linkgoron@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Followup to #48518; fixes #48699
Happy to add a test if needed - but I both wasn't sure where it would go, and I also wasn't sure if this was worth testing since node rarely polyfills JS builtins and v8 will supply it soon enough anyways (backed by test262)