Skip to content

V8 Updates: Replace deprecated SetAccessor with SetAccessorProperty - #2156

Merged
jasnell merged 2 commits into
mainfrom
jsnell/replace-deprecated-setaccessor
May 27, 2024
Merged

V8 Updates: Replace deprecated SetAccessor with SetAccessorProperty#2156
jasnell merged 2 commits into
mainfrom
jsnell/replace-deprecated-setaccessor

Conversation

@jasnell

@jasnell jasnell commented May 23, 2024

Copy link
Copy Markdown
Collaborator

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 harrishancock and kentonv May 23, 2024 23:32
@jasnell
jasnell requested review from a team as code owners May 23, 2024 23:32
Comment thread src/workerd/api/http-test.js
Comment thread src/workerd/jsg/resource.h Outdated
@jasnell
jasnell force-pushed the jsnell/replace-deprecated-setaccessor branch from 7c72cec to 2bf502b Compare May 23, 2024 23:37
Comment thread src/workerd/jsg/resource.h Outdated
@jasnell jasnell changed the title Replace deprecated SetAccessor with SetAccessorProperty V8 Updates: Replace deprecated SetAccessor with SetAccessorProperty May 24, 2024
Comment thread src/workerd/jsg/resource.h Outdated
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
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.

2 participants