Files
node/doc/api
Gabriel Schulhof d5b397c9b6 n-api: Implement stricter wrapping
Use a stronger criterion to identify objects in the prototype chain that store
pointers to native data that were added by previous calls to `napi_wrap()`.

Whereas the old criterion for identifying `napi_wrap()`-injected prototype
chain objects was to consider an object with an internal field
count of 1 to be such an object, the new criterion is to consider an object
with an internal field count of 2 such that the second field holds a
`v8::External` which itself contains a pointer to a global static string unique
to N-API to be a `napi_wrap()`-injected prototype chain object.

This greatly reduces the possibility of returning a pointer that was not
previously added with `napi_wrap()`, and it allows us to recognize that an
object has already undergone `napi_wrap()` and we can thus prevent a chain of
wrappers only the first of which is accessible from appearing in the prototype
chain, as would be the result of multiple calls to `napi_wrap()` using the same
object.

PR-URL: https://github.com/nodejs/node/pull/13872
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-07-12 12:05:44 -04:00
..
2017-07-06 11:19:34 +08:00
2017-07-06 11:19:34 +08:00
2017-06-26 22:41:01 +03:00
2017-07-03 11:06:36 +02:00
2017-07-03 11:06:36 +02:00
2017-05-30 10:58:31 -07:00
2017-05-30 10:58:31 -07:00
2017-07-12 15:18:53 +02:00
2017-07-09 18:47:35 +02:00
2016-04-20 16:34:27 -07:00
2017-07-02 21:44:46 +02:00
2017-07-06 11:19:34 +08:00
2017-07-12 12:05:44 -04:00
2017-06-28 14:25:37 +02:00
2017-05-23 20:41:13 +02:00
2017-05-09 15:01:44 +02:00
2017-06-14 00:18:59 +02:00
2016-12-20 12:31:09 -08:00
2017-06-14 00:18:59 +02:00