Skip to content

Commit

Permalink
src: port V8 12.1 compat patch
Browse files Browse the repository at this point in the history
  • Loading branch information
targos authored and nodejs-github-bot committed Nov 17, 2023
1 parent 0b876cd commit 0186de2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 36 deletions.
7 changes: 2 additions & 5 deletions src/js_native_api_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -968,11 +968,8 @@ napi_define_class(napi_env env,
env, p->setter, p->data, &setter_tpl));
}

tpl->PrototypeTemplate()->SetAccessorProperty(property_name,
getter_tpl,
setter_tpl,
attributes,
v8::AccessControl::DEFAULT);
tpl->PrototypeTemplate()->SetAccessorProperty(
property_name, getter_tpl, setter_tpl, attributes);
} else if (p->method != nullptr) {
v8::Local<v8::FunctionTemplate> t;
STATUS_CALL(v8impl::FunctionCallbackWrapper::NewTemplate(
Expand Down
63 changes: 32 additions & 31 deletions src/node_builtins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -680,37 +680,38 @@ void BuiltinLoader::CreatePerIsolateProperties(IsolateData* isolate_data,
Local<ObjectTemplate> target) {
Isolate* isolate = isolate_data->isolate();

target->SetAccessor(isolate_data->config_string(),
ConfigStringGetter,
nullptr,
Local<Value>(),
DEFAULT,
None,
SideEffectType::kHasNoSideEffect);

target->SetAccessor(FIXED_ONE_BYTE_STRING(isolate, "builtinIds"),
BuiltinIdsGetter,
nullptr,
Local<Value>(),
DEFAULT,
None,
SideEffectType::kHasNoSideEffect);

target->SetAccessor(FIXED_ONE_BYTE_STRING(isolate, "builtinCategories"),
GetBuiltinCategories,
nullptr,
Local<Value>(),
DEFAULT,
None,
SideEffectType::kHasNoSideEffect);

target->SetAccessor(FIXED_ONE_BYTE_STRING(isolate, "natives"),
GetNatives,
nullptr,
Local<Value>(),
DEFAULT,
None,
SideEffectType::kHasNoSideEffect);
target->SetNativeDataProperty(isolate_data->config_string(),
ConfigStringGetter,
nullptr,
Local<Value>(),
None,
DEFAULT,
SideEffectType::kHasNoSideEffect);

target->SetNativeDataProperty(FIXED_ONE_BYTE_STRING(isolate, "builtinIds"),
BuiltinIdsGetter,
nullptr,
Local<Value>(),
None,
DEFAULT,
SideEffectType::kHasNoSideEffect);

target->SetNativeDataProperty(
FIXED_ONE_BYTE_STRING(isolate, "builtinCategories"),
GetBuiltinCategories,
nullptr,
Local<Value>(),
None,
DEFAULT,
SideEffectType::kHasNoSideEffect);

target->SetNativeDataProperty(FIXED_ONE_BYTE_STRING(isolate, "natives"),
GetNatives,
nullptr,
Local<Value>(),
None,
DEFAULT,
SideEffectType::kHasNoSideEffect);

SetMethod(isolate, target, "getCacheUsage", BuiltinLoader::GetCacheUsage);
SetMethod(isolate, target, "compileFunction", BuiltinLoader::CompileFunction);
Expand Down

0 comments on commit 0186de2

Please sign in to comment.