Skip to content

Commit 1acab66

Browse files
kfarnungMylesBorins
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. Backport-PR-URL: #19447 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 f4d1cae commit 1acab66

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
@@ -58,7 +58,8 @@ struct napi_env__ {
5858
(destination)->SetInternalFieldCount((field_count)); \
5959
(env)->prefix ## _template.Reset(isolate, (destination)); \
6060
} else { \
61-
(destination) = env->prefix ## _template.Get(isolate); \
61+
(destination) = v8::Local<v8::ObjectTemplate>::New( \
62+
isolate, env->prefix ## _template); \
6263
} \
6364
} while (0)
6465

0 commit comments

Comments
 (0)