Skip to content

Commit ab7387e

Browse files
targosnodejs-github-bot
authored andcommitted
src: port V8 12.1 compat patch
Refs: nodejs/node#50709
1 parent 1067cf4 commit ab7387e

File tree

2 files changed

+34
-36
lines changed

2 files changed

+34
-36
lines changed

src/js_native_api_v8.cc

+2-5
Original file line numberDiff line numberDiff line change
@@ -968,11 +968,8 @@ napi_define_class(napi_env env,
968968
env, p->setter, p->data, &setter_tpl));
969969
}
970970

971-
tpl->PrototypeTemplate()->SetAccessorProperty(property_name,
972-
getter_tpl,
973-
setter_tpl,
974-
attributes,
975-
v8::AccessControl::DEFAULT);
971+
tpl->PrototypeTemplate()->SetAccessorProperty(
972+
property_name, getter_tpl, setter_tpl, attributes);
976973
} else if (p->method != nullptr) {
977974
v8::Local<v8::FunctionTemplate> t;
978975
STATUS_CALL(v8impl::FunctionCallbackWrapper::NewTemplate(

src/node_builtins.cc

+32-31
Original file line numberDiff line numberDiff line change
@@ -680,37 +680,38 @@ void BuiltinLoader::CreatePerIsolateProperties(IsolateData* isolate_data,
680680
Local<ObjectTemplate> target) {
681681
Isolate* isolate = isolate_data->isolate();
682682

683-
target->SetAccessor(isolate_data->config_string(),
684-
ConfigStringGetter,
685-
nullptr,
686-
Local<Value>(),
687-
DEFAULT,
688-
None,
689-
SideEffectType::kHasNoSideEffect);
690-
691-
target->SetAccessor(FIXED_ONE_BYTE_STRING(isolate, "builtinIds"),
692-
BuiltinIdsGetter,
693-
nullptr,
694-
Local<Value>(),
695-
DEFAULT,
696-
None,
697-
SideEffectType::kHasNoSideEffect);
698-
699-
target->SetAccessor(FIXED_ONE_BYTE_STRING(isolate, "builtinCategories"),
700-
GetBuiltinCategories,
701-
nullptr,
702-
Local<Value>(),
703-
DEFAULT,
704-
None,
705-
SideEffectType::kHasNoSideEffect);
706-
707-
target->SetAccessor(FIXED_ONE_BYTE_STRING(isolate, "natives"),
708-
GetNatives,
709-
nullptr,
710-
Local<Value>(),
711-
DEFAULT,
712-
None,
713-
SideEffectType::kHasNoSideEffect);
683+
target->SetNativeDataProperty(isolate_data->config_string(),
684+
ConfigStringGetter,
685+
nullptr,
686+
Local<Value>(),
687+
None,
688+
DEFAULT,
689+
SideEffectType::kHasNoSideEffect);
690+
691+
target->SetNativeDataProperty(FIXED_ONE_BYTE_STRING(isolate, "builtinIds"),
692+
BuiltinIdsGetter,
693+
nullptr,
694+
Local<Value>(),
695+
None,
696+
DEFAULT,
697+
SideEffectType::kHasNoSideEffect);
698+
699+
target->SetNativeDataProperty(
700+
FIXED_ONE_BYTE_STRING(isolate, "builtinCategories"),
701+
GetBuiltinCategories,
702+
nullptr,
703+
Local<Value>(),
704+
None,
705+
DEFAULT,
706+
SideEffectType::kHasNoSideEffect);
707+
708+
target->SetNativeDataProperty(FIXED_ONE_BYTE_STRING(isolate, "natives"),
709+
GetNatives,
710+
nullptr,
711+
Local<Value>(),
712+
None,
713+
DEFAULT,
714+
SideEffectType::kHasNoSideEffect);
714715

715716
SetMethod(isolate, target, "getCacheUsage", BuiltinLoader::GetCacheUsage);
716717
SetMethod(isolate, target, "compileFunction", BuiltinLoader::CompileFunction);

0 commit comments

Comments
 (0)