Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test that fails when v8 is built with is_debug and dcheck_always_on #175

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions test/test_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,21 @@ void test_context()

// Isolate and HandleScope shall exist before init_global
v8::Isolate* isolate = v8pp::context::create_isolate();
v8::HandleScope scope(isolate);
{
v8::Isolate::Scope isolate_scope(isolate);
v8::HandleScope scope(isolate);

v8pp::context::options opt;
opt.isolate = isolate; // use existing one
opt.add_default_global_methods = false;
opt.global = init_global(isolate);
v8pp::context::options opt;
opt.isolate = isolate; // use existing one
opt.add_default_global_methods = false;
opt.global = init_global(isolate);

v8pp::context context(opt);
v8pp::context context(opt);

int const r = context.run_script("value + func()")->Int32Value(context.isolate()->GetCurrentContext()).FromJust();
int const r = context.run_script("value + func()")->Int32Value(context.isolate()->GetCurrentContext()).FromJust();

check_eq("run_script with customized global", r, 42);
check_eq("run_script with customized global", r, 42);
}
isolate->Dispose();
}
}