-
Notifications
You must be signed in to change notification settings - Fork 30k
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
node-api: provide napi_define_properties fast path #48440
node-api: provide napi_define_properties fast path #48440
Conversation
Review requested:
|
e9a4032
to
d8299a4
Compare
|
d8299a4
to
9e08c8b
Compare
Implement defining properties via V8's `v8::Object::CreateDataProperty()`, which is faster for data-valued, writable, configurable, and enumerable properties. Re: nodejs#45905 Signed-off-by: Gabriel Schulhof <Gschulhof@auction.com>
9e08c8b
to
4049162
Compare
|
||
auto define_maybe = | ||
obj->DefineProperty(context, property_name, descriptor); | ||
defined_successfully = define_maybe.FromMaybe(false); |
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.
I think we should distinguish the state that the DefineProperty
operation is failed (e.g. when the object is frozen) or the DefineProperty
operation is throwing (e.g. a throwing Proxy handler defineProperty
) and returning a different napi_status
. As this behavior is not introduced in this PR, I'll create a follow-up PR to do so.
Implement defining properties via V8's `v8::Object::CreateDataProperty()`, which is faster for data-valued, writable, configurable, and enumerable properties. Re: #45905 Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com> PR-URL: #48440 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Landed in 3c35cd4. |
Implement defining properties via V8's `v8::Object::CreateDataProperty()`, which is faster for data-valued, writable, configurable, and enumerable properties. Re: #45905 Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com> PR-URL: #48440 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Implement defining properties via V8's `v8::Object::CreateDataProperty()`, which is faster for data-valued, writable, configurable, and enumerable properties. Re: nodejs#45905 Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com> PR-URL: nodejs#48440 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Implement defining properties via V8's `v8::Object::CreateDataProperty()`, which is faster for data-valued, writable, configurable, and enumerable properties. Re: nodejs#45905 Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com> PR-URL: nodejs#48440 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Implement defining properties via V8's `v8::Object::CreateDataProperty()`, which is faster for data-valued, writable, configurable, and enumerable properties. Re: #45905 Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com> PR-URL: #48440 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Implement defining properties via V8's `v8::Object::CreateDataProperty()`, which is faster for data-valued, writable, configurable, and enumerable properties. Re: #45905 Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com> PR-URL: #48440 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Implement defining properties via V8's
v8::Object::CreateDataProperty()
, which is faster for data-valued,writable, configurable, and enumerable properties.
Re: #45905