Skip to content

Commit

Permalink
Fix for new V8 API
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Feb 1, 2024
1 parent aac833b commit b4f99ca
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 36 deletions.
7 changes: 7 additions & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -1557,6 +1557,13 @@
'tools/executable_wrapper.h'
],
'conditions': [
[ 'OS=="linux"', {
'ldflags': [ '-L<(PRODUCT_DIR)/../nw/lib/',
'-Wl,--whole-archive',
'<(LIBCXX)',
'-Wl,--no-whole-archive'
]
}],
[ 'node_shared_libuv=="false"', {
'dependencies': [ 'deps/uv/uv.gyp:libuv#host' ],
}],
Expand Down
7 changes: 2 additions & 5 deletions src/js_native_api_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -961,11 +961,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 @@ -682,37 +682,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 b4f99ca

Please sign in to comment.