8000 n-api: directly create Local from Persistent · nodejs/node@1acab66 · GitHub
[go: up one dir, main page]

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 <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>
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

Lines changed: 2 additions & 1 deletion
< 591E td data-grid-cell-id="diff-2057dbe503dbb37a65a74cf86e056d50c27ba828070577e0f7f07e734365c9bc-61-60-0" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-deletionNum-bgColor, var(--diffBlob-deletion-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">61
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 { \
-
(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)
0