@@ -1085,7 +1085,7 @@ std::vector<MetadataNode::MethodCallbackData *> MetadataNode::SetClassMembersFro
10851085 napi_create_function (env, methodName.c_str (), methodName.size (), MethodCallback,
10861086 callbackData, &method);
10871087
1088- napi_set_named_property (env, prototype, methodName.c_str (), method);
1088+ napi_util::define_property_value (env, prototype, methodName.c_str (), method, napi_default_method );
10891089 lastMethodName = methodName;
10901090 collectedExtensionMethods.emplace (methodName, callbackData);
10911091
@@ -1112,7 +1112,7 @@ std::vector<MetadataNode::MethodCallbackData *> MetadataNode::SetClassMembersFro
11121112 napi_value method;
11131113 napi_create_function (env, methodName.c_str (), methodName.size (), MethodCallback,
11141114 callbackData, &method);
1115- napi_set_named_property (env, prototype, methodName.c_str (), method);
1115+ napi_util::define_property_value (env, prototype, methodName.c_str (), method, napi_default_method );
11161116 collectedExtensionMethods.emplace (methodName, callbackData);
11171117 }
11181118
@@ -1199,7 +1199,8 @@ std::vector<MetadataNode::MethodCallbackData *> MetadataNode::SetClassMembersFro
11991199 napi_value method;
12001200 napi_create_function (env, methodName.c_str (), methodName.size (), MethodCallback,
12011201 callbackData, &method);
1202- napi_set_named_property (env, constructor, methodName.c_str (), method);
1202+
1203+ napi_util::define_property_value (env, constructor, methodName.c_str (), method, napi_default_method);
12031204 lastMethodName = methodName;
12041205 }
12051206 callbackData->candidates .push_back (std::move (entry));
@@ -1234,6 +1235,7 @@ std::vector<MetadataNode::MethodCallbackData *> MetadataNode::SetClassMembersFro
12341235 ArgConverter::convertToJsString (env, tname));
12351236
12361237 SetClassAccessor (env, constructor);
1238+
12371239 return instanceMethodData;
12381240}
12391241
@@ -1992,7 +1994,7 @@ napi_value MetadataNode::MethodCallback(napi_env env, napi_callback_info info) {
19921994
19931995
19941996 if (argc == 0 && methodName == PROP_KEY_VALUEOF) {
1995- return jsThis;
1997+ return jsThis;
19961998 } else {
19971999// Runtime::GetRuntime(env)->clearPendingError();
19982000 bool isFromInterface = initialCallbackData->node ->IsNodeTypeInterface ();
0 commit comments