Skip to content

vm: fix copying PropertyDescriptor#64073

Open
legendecas wants to merge 1 commit into
nodejs:mainfrom
legendecas:vm-define
Open

vm: fix copying PropertyDescriptor#64073
legendecas wants to merge 1 commit into
nodejs:mainfrom
legendecas:vm-define

Conversation

@legendecas

@legendecas legendecas commented Jun 22, 2026

Copy link
Copy Markdown
Member

This fixes a long-standing issue that
ContextifyContext::PropertyDefinerCallback incorrectly copies the
const PropertyDescriptor& desc, assigning value to be undefined when
no value present on the PropertyDescriptor.

This is revealed after #63549 because
returning kYes tells V8 that the definer handled it, and V8 no longer
fixes it up.

Fixes: #64008

/cc @nodejs/vm

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. vm Issues and PRs related to the vm subsystem. labels Jun 22, 2026
@legendecas legendecas changed the title src: fix copying PropertyDescriptor vm: fix copying PropertyDescriptor Jun 22, 2026
This fixes a long-standing issue that
`ContextifyContext::PropertyDefinerCallback` incorrectly copies the
`const PropertyDescriptor& desc`, assigning value to be `undefined` when
no value present on the `PropertyDescriptor`.

This is revealed after nodejs#63549 because
returning `kYes` tells V8 that the definer handled it, and V8 no longer
fixes it up.

Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. vm Issues and PRs related to the vm subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vm: Object.defineProperty doesn't work properly for globalThis

2 participants