Skip to content
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

V8 Updates: Replace deprecated SetAccessor with SetAccessorProperty #2156

Merged
merged 2 commits into from
May 27, 2024

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented May 23, 2024

V8 has deprecated the SetAccessor method. Per the deprecation message, we're supposed to replace it with SetNativeDataProperty. Unfortunately, SetNativeDataProperty does not work with setters specified on the prototype. Doh! Per feedback from the v8 team, we should use SetAccessorProperty for this case instead.

Unfortunately, SetAccessorProperty is not a drop in replacement for the deprecated SetAccessor and requires more extensive changes than simply calling a different method.

Can't say that I'm entirely happy with this PR as is given the duplication is ends up introducing. We may want to revisit this whole bit to determine if there's a way of simplifying things.

@jasnell jasnell requested review from a team as code owners May 23, 2024 23:32
src/workerd/jsg/resource.h Outdated Show resolved Hide resolved
@jasnell jasnell force-pushed the jsnell/replace-deprecated-setaccessor branch from 7c72cec to 2bf502b Compare May 23, 2024 23:37
src/workerd/jsg/resource.h Outdated Show resolved Hide resolved
@jasnell jasnell changed the title Replace deprecated SetAccessor with SetAccessorProperty V8 Updates: Replace deprecated SetAccessor with SetAccessorProperty May 24, 2024
src/workerd/jsg/resource.h Outdated Show resolved Hide resolved
V8 has deprecated the SetAccessor method. Per the deprecation
message, we're supposed to replace it with SetNativeDataProperty.
Unfortunately, SetNativeDataProperty does not work with setters
specified on the prototype. Doh! Per feedback from the v8 team,
we should use SetAccessorProperty for this case instead.

Unfortunately, SetAccessorProperty is not a drop in replacement
for the deprecated SetAccessor and requires more extensive changes
than simply calling a different method.
@jasnell jasnell force-pushed the jsnell/replace-deprecated-setaccessor branch from 2bf502b to 279406c Compare May 27, 2024 20:56
@jasnell jasnell merged commit 91b719e into main May 27, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants