Skip to content

Commit 6078dea

Browse files
kfarnungaddaleax
authored andcommitted
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: #14211 Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Jason Ginchereau <[email protected]>
1 parent 14f6a5a commit 6078dea

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/node_api.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ struct napi_env__ {
5656
(destination)->SetInternalFieldCount((field_count)); \
5757
(env)->prefix ## _template.Reset(isolate, (destination)); \
5858
} else { \
59-
(destination) = env->prefix ## _template.Get(isolate); \
59+
(destination) = v8::Local<v8::ObjectTemplate>::New( \
60+
isolate, env->prefix ## _template); \
6061
} \
6162
} while (0)
6263

0 commit comments

Comments
 (0)