summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJckXia <ys3xia@uwaterloo.ca>2021-08-28 20:59:16 -0400
committerBeth Griggs <bgriggs@redhat.com>2021-09-21 19:13:37 +0100
commitfe920b6cbfc415658e1ca2c1f667f705963ff761 (patch)
tree4ee25bd3e893f76e536c5c4aa1801c068d53a8f9 /src
parent846e7e880e2fd461a67ad13aeb883113406b4d07 (diff)
downloadnode-new-fe920b6cbfc415658e1ca2c1f667f705963ff761.tar.gz
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>
Diffstat (limited to 'src')
-rw-r--r--src/js_native_api_v8.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc
index 5d18980fc7..754d71f51d 100644
--- a/src/js_native_api_v8.cc
+++ b/src/js_native_api_v8.cc
@@ -2460,9 +2460,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 =