Skip to content

Commit 92ae4f4

Browse files
daviddavid
david
authored and
david
committed
fix: Context::Global() need Context::Scope
1 parent 20377f1 commit 92ae4f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bridge/bindings/v8/v8_member_installer.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ namespace webf {
1111
void MemberInstaller::InstallFunctions(ExecutingContext* context,
1212
std::initializer_list<FunctionConfig> config) {
1313
v8::Isolate* isolate = context->ctx();
14-
v8::Local<v8::Context> v8_context = isolate->GetCurrentContext();
14+
v8::Local<v8::Context> v8_context = v8::Context::New(isolate);
15+
v8::Context::Scope context_scope(v8_context);
1516
v8::Local<v8::Object> global = v8_context->Global();
1617

1718
for (const auto& function : config) {

0 commit comments

Comments
 (0)