n-api: directly create Local from Persistent
The `v8::PersistentBase<T>.Get` method didn't exist in node 4 and it's just a helper which creates a new `v8::Local` from the given object. PR-URL: https://github.com/nodejs/node/pull/14211 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Jason Ginchereau <jasongin@microsoft.com>
This commit is contained in:
parent
8f0102564e
commit
e59987c39e
@ -56,7 +56,8 @@ struct napi_env__ {
|
||||
(destination)->SetInternalFieldCount((field_count)); \
|
||||
(env)->prefix ## _template.Reset(isolate, (destination)); \
|
||||
} else { \
|
||||
(destination) = env->prefix ## _template.Get(isolate); \
|
||||
(destination) = v8::Local<v8::ObjectTemplate>::New( \
|
||||
isolate, env->prefix ## _template); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user