Uh oh!
There was an error while loading. Please reload this page.
n-api: define ECMAScript-compliant accessors on napi_define_* - #27851
n-api: define ECMAScript-compliant accessors on napi_define_*#27851legendecas wants to merge 2 commits into
Conversation
1deb5fc to
1dfa776CompareUh oh!
There was an error while loading. Please reload this page.
0144dfe to
1514b11Comparemhdawson
commented
May 27, 2019
Overall I think this looks good. Since it is changing behaviour and N-API modules should run across LTS versions I think I should ask how likely it is to break existing code. My assumption is extremely low as it is changing from behaviour that is unexpected and to what should be expected. Still would like @legendecas and @addaleax to weigh in on that front. |
TimothyGu
left a comment
There was a problem hiding this comment.
The existing change looks good. You should probably change napi_define_class()https://github.com/nodejs/node/blob/1514b117c6e1ecd36f1a3c6b044d5f8094be8b19/src/js_native_api_v8.cc#L804-L838 the same way, and then remove V8PropertyAttributesFromDescriptor and CreateAccessorCallbackData.
Uh oh!
There was an error while loading. Please reload this page.
legendecas
commented
May 28, 2019
AFAIK, there would be an error on invoking A case could be got hands on: And v8 doesn't provide an API to define ECMA compliant accessors on the |
V8 does support that, as Lines 1027 to 1040 in aa42d37 v8::Template::Set() is used. Note in particular the use of v8::Signature there, which makes things like Object.getOwnPropertyDescriptor(MyClass.prototype, 'prop').get.call(notMyClassObj) throw an error. |
legendecas
commented
May 28, 2019
@TimothyGu Thank you for your detailed explanation! I'll try to fix |
b7f2dd7 to
5efe42cCompare5efe42c to
0f22b86Compared1731b7 to
fdea3b6Comparefdea3b6 to
2dfecc4Comparelegendecas
commented
Jun 3, 2019
I have updated the |
legendecas
commented
Jun 11, 2019
ping n-api team, please take a look :) |
mhdawson
commented
Jun 13, 2019
Was hoping for some feedback from @legendecas and @addaleax in terms of how much risk there is in terms of breaking existing code? |
For For Thus there would not be noticeable breaking on existing code IMHO. |
mhdawson
commented
Jun 13, 2019
@legendecas I did validate that the current patch fixes nodejs/node-addon-api#485. It does break one of the node-addon-api tests but I think its a test problem so I'll look at fixing that. |
addaleax
commented
Jun 13, 2019
mhdawson
commented
Jun 13, 2019
Looks good but we should land nodejs/node-addon-api#495 first so that we don't break the node-addon-api tests. |
mhdawson
commented
Jun 13, 2019
Added the blocked label until we get the node-add-api fix in. Will try to expedite that. |
mhdawson
commented
Jun 13, 2019
Removed blocked label as update to node-addon-api testcase is now landed. |
PR-URL: nodejs#27851Fixes: nodejs#26551Fixes: nodejs/node-addon-api#485 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: nodejs#27851Fixes: nodejs#26551Fixes: nodejs/node-addon-api#485 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
BridgeAR
commented
Jun 17, 2019
PR-URL: #27851Fixes: #26551Fixes: nodejs/node-addon-api#485 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #27851Fixes: #26551Fixes: nodejs/node-addon-api#485 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #27851Fixes: #26551Fixes: nodejs/node-addon-api#485 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #27851Fixes: #26551Fixes: nodejs/node-addon-api#485 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Notable changes: This release contains `semver-major` commits. These are in fact not `semver-major` due to follow-up commits that remove all breaking changes. * build: * The startup time is reduced by enabling V8 snapshots by default #28181 * deps: * Updated `V8` to 7.5.288.22 #27375 * The numeric separator (v8.dev/features/numeric-separators) feature is now enabled by default * Updated `OpenSSL` to 1.1.1c #28211 * inspector: * The `--inspect-publish-uid` flag was added to specify ways of the inspector web socket url exposure #27741 * n-api: * Accessors on napi_define_* are now ECMAScript-compliant #27851 * report: * The cpu info got added to the report output #28188 * src: * Restore the original state of the stdio file descriptors on exit to prevent leaving stdio in raw or non-blocking mode #24260 * tools,gyp: * Introduce MSVS 2019 #27375 * util: * inspect: * Array grouping became more compact and uses more columns than before #28059#28070 * Long strings will not be split at 80 characters anymore. Instead they will be split on new lines #28055 * worker: * `worker.terminate()` now returns a promise and using the callback is deprecated #28021 PR-URL: #28268
Notable changes: * build: * The startup time is reduced by enabling V8 snapshots by default #28181 * deps: * Updated `V8` to 7.5.288.22 #27375 * The numeric separator (v8.dev/features/numeric-separators) feature is now enabled by default * Updated `OpenSSL` to 1.1.1c #28211 * inspector: * The `--inspect-publish-uid` flag was added to specify ways of the inspector web socket url exposure #27741 * n-api: * Accessors on napi_define_* are now ECMAScript-compliant #27851 * report: * The cpu info got added to the report output #28188 * src: * Restore the original state of the stdio file descriptors on exit to prevent leaving stdio in raw or non-blocking mode #24260 * tools,gyp: * Introduce MSVS 2019 #27375 * util: * inspect: * Array grouping became more compact and uses more columns than before #28059#28070 * Long strings will not be split at 80 characters anymore. Instead they will be split on new lines #28055 * worker: * `worker.terminate()` now returns a promise and using the callback is deprecated #28021 PR-URL: #28268
Notable changes: * build: * The startup time is reduced by enabling V8 snapshots by default #28181 * deps: * Updated `V8` to 7.5.288.22 #27375 * The numeric separator (v8.dev/features/numeric-separators) feature is now enabled by default * Updated `OpenSSL` to 1.1.1c #28211 * inspector: * The `--inspect-publish-uid` flag was added to specify ways of the inspector web socket url exposure #27741 * n-api: * Accessors on napi_define_* are now ECMAScript-compliant #27851 * report: * The cpu info got added to the report output #28188 * src: * Restore the original state of the stdio file descriptors on exit to prevent leaving stdio in raw or non-blocking mode #24260 * tools,gyp: * Introduce MSVS 2019 #27375 * util: * inspect: * Array grouping became more compact and uses more columns than before #28059#28070 * Long strings will not be split at 80 characters anymore. Instead they will be split on new lines #28055 * worker: * `worker.terminate()` now returns a promise and using the callback is deprecated #28021 PR-URL: #28268
Notable changes: * build: * The startup time is reduced by enabling V8 snapshots by default #28181 * deps: * Updated `V8` to 7.5.288.22 #27375 * The numeric separator (v8.dev/features/numeric-separators) feature is now enabled by default * Updated `OpenSSL` to 1.1.1c #28211 * inspector: * The `--inspect-publish-uid` flag was added to specify ways of the inspector web socket url exposure #27741 * n-api: * Accessors on napi_define_* are now ECMAScript-compliant #27851 * report: * The cpu info got added to the report output #28188 * src: * Restore the original state of the stdio file descriptors on exit to prevent leaving stdio in raw or non-blocking mode #24260 * tools,gyp: * Introduce MSVS 2019 #27375 * util: * inspect: * Array grouping became more compact and uses more columns than before #28059#28070 * Long strings will not be split at 80 characters anymore. Instead they will be split on new lines #28055 * worker: * `worker.terminate()` now returns a promise and using the callback is deprecated #28021 PR-URL: #28268
Notable changes: * build: * The startup time is reduced by enabling V8 snapshots by default nodejs#28181 * deps: * Updated `V8` to 7.5.288.22 nodejs#27375 * The numeric separator (v8.dev/features/numeric-separators) feature is now enabled by default * Updated `OpenSSL` to 1.1.1c nodejs#28211 * inspector: * The `--inspect-publish-uid` flag was added to specify ways of the inspector web socket url exposure nodejs#27741 * n-api: * Accessors on napi_define_* are now ECMAScript-compliant nodejs#27851 * report: * The cpu info got added to the report output nodejs#28188 * src: * Restore the original state of the stdio file descriptors on exit to prevent leaving stdio in raw or non-blocking mode nodejs#24260 * tools,gyp: * Introduce MSVS 2019 nodejs#27375 * util: * inspect: * Array grouping became more compact and uses more columns than before nodejs#28059nodejs#28070 * Long strings will not be split at 80 characters anymore. Instead they will be split on new lines nodejs#28055 * worker: * `worker.terminate()` now returns a promise and using the callback is deprecated nodejs#28021 PR-URL: nodejs#28268
Fixes: #26551
Fixes: nodejs/node-addon-api#485
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes