diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-12-18 17:28:24 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-12-24 16:35:22 +0300 |
commit | e23bf8f771aa0bd60e25ff079985fc29b5846403 (patch) | |
tree | 228f9e5323c04c69d3cadeaf2eed74e22832b8be /src | |
parent | 62436c2fb340c9a28f796cda92b257c73487fd5c (diff) |
tools,src: forbid usage of v8::Persistent
`v8::Persistent` comes with the surprising catch that it requires
manual cleanup. `v8::Global` doesn’t, making it easier to use,
and additionally provides move semantics. New code should always
use `v8::Global`.
PR-URL: https://github.com/nodejs/node/pull/31018
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_object_wrap.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_object_wrap.h b/src/node_object_wrap.h index 9dce684892a..cb13d84388b 100644 --- a/src/node_object_wrap.h +++ b/src/node_object_wrap.h @@ -65,6 +65,7 @@ class ObjectWrap { } + // NOLINTNEXTLINE(runtime/v8_persistent) inline v8::Persistent<v8::Object>& persistent() { return handle_; } @@ -122,6 +123,7 @@ class ObjectWrap { delete wrap; } + // NOLINTNEXTLINE(runtime/v8_persistent) v8::Persistent<v8::Object> handle_; }; |