-
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
[v18.x backport] url: ensure getter access do not mutate observable symbols #48891
Conversation
Review requested:
|
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1354/ Results
|
The test's assumptions about RSS are no longer valid, at least with Fedora 38. Closes: nodejs#48490 PR-URL: nodejs#48811 Fixes: nodejs#48490 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
Benchmark results are mixed, but I think it makes sense to move forward with this change. |
PR-URL: nodejs#48897 Refs: nodejs#48891 Refs: nodejs#48886 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
c73411e
to
eb29d9a
Compare
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.
LGTM w/ or w/o nits
@@ -179,7 +186,7 @@ class URLContext { | |||
} | |||
|
|||
function isURLSearchParams(self) { | |||
return self && self[searchParams] && !self[searchParams][searchParams]; | |||
return self?.[searchParams]; |
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.
return self?.[searchParams]; | |
return Boolean(self?.[searchParams]); |
return this[searchParams]; | ||
|
||
const cachedValue = internalSearchParams.get(this); | ||
if (cachedValue != null) |
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.
if (cachedValue != null) | |
if (cachedValue !== undefined) |
PR-URL: nodejs#48897 Refs: nodejs#48891 Refs: nodejs#48886 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: nodejs#48897 Refs: nodejs#48891 Refs: nodejs#48886 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: nodejs#48897 Refs: nodejs#48891 Refs: nodejs#48886 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
a05f72f
to
e7d2e8e
Compare
PR-URL: nodejs#48897 Refs: nodejs#48891 Refs: nodejs#48886 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: nodejs#48897 Refs: nodejs#48891 Refs: nodejs#48886 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
PR-URL: nodejs#48897 Refs: nodejs#48891 Refs: nodejs#48886 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
@aduh95 Is this ready to land on v18.x? |
Yes it is ready. |
Landed in 0beb5ab |
Opening as draft so we can run benchmarks, if the perf looks OK, I'll open another PR to land the test on
main
first.Refs: #48886