src: make napi_create_reference accept symbol

PR-URL: https://github.com/nodejs/node/pull/39926
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
JckXia authored and Richard Lau committed 2022-01-25 12:38:26 -05:00
1 parent fc328f1ab0
commit f74fe2a59c
3 files changed
+25 -3

No files matched your search

+3 -3
View File
@@ -2454,9 +2454,9 @@ napi_status napi_create_reference(napi_env env,
CHECK_ARG(env, result);
v8::Local<v8::Value> v8_value = v8impl::V8LocalValueFromJsValue(value);
if (!(v8_value->IsObject() || v8_value->IsFunction())) {
return napi_set_last_error(env, napi_object_expected);
if (!(v8_value->IsObject() || v8_value->IsFunction() ||
v8_value->IsSymbol())) {
return napi_set_last_error(env, napi_invalid_arg);
}
v8impl::Reference* reference =