Skip to content

fix: restore SetAccessor for proper getter/setter functionality#229

Closed
jacobsologub wants to merge 0 commit intopmed:masterfrom
jacobsologub:fix/getter-setter-issue-226
Closed

fix: restore SetAccessor for proper getter/setter functionality#229
jacobsologub wants to merge 0 commit intopmed:masterfrom
jacobsologub:fix/getter-setter-issue-226

Conversation

@jacobsologub
Copy link
Contributor

Reverts the use of SetNativeDataProperty back to SetAccessor to fix getter/setter callbacks not being triggered properly.

SetNativeDataProperty creates pseudo-data properties that don't properly handle setter callbacks, especially on prototype chains. SetAccessor creates true accessor properties that work as expected.

Fixes #226

  • Use SetAccessor instead of SetNativeDataProperty in class.hpp
  • Use SetAccessor instead of SetNativeDataProperty in module.hpp
  • Remove v8::DEFAULT parameter for compatibility with newer V8 versions
  • Keep modern AccessorNameGetterCallback/AccessorNameSetterCallback types

@jacobsologub jacobsologub force-pushed the fix/getter-setter-issue-226 branch from 2319567 to 96a44bf Compare June 1, 2025 21:21
@jacobsologub jacobsologub force-pushed the fix/getter-setter-issue-226 branch from 96a44bf to f08867e Compare June 1, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Question: My class getters and setters stopped working (test case included)

1 participant