From 787f09b49fdabcb1fe44f76a631d3418bb406282 Mon Sep 17 00:00:00 2001 From: Kyle Farnung Date: Wed, 12 Jul 2017 17:14:00 -0700 Subject: [PATCH] n-api: directly create Local from Persistent The `v8::PersistentBase.Get` method didn't exist in node 4 and it's just a helper which creates a new `v8::Local` from the given object. --- src/node_api.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_api.cc b/src/node_api.cc index 5818cb25c1b6e8..59bac3a9c1179a 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -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::New( \ + isolate, env->prefix ## _template); \ } \ } while (0)