Skip to content

Commit

Permalink
Remove calls to APIs deprecated in version 12.6 and removed in 12.7 (n…
Browse files Browse the repository at this point in the history
  • Loading branch information
ajklein authored May 14, 2024
1 parent b5a7a8a commit abd9454
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
4 changes: 1 addition & 3 deletions src/module_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ MaybeLocal<Module> ModuleWrap::CompileSourceTextModule(
bool* cache_rejected) {
Isolate* isolate = realm->isolate();
EscapableHandleScope scope(isolate);
ScriptOrigin origin(isolate,
url,
ScriptOrigin origin(url,
line_offset,
column_offset,
true, // is cross origin
Expand Down Expand Up @@ -580,7 +579,6 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {

ShouldNotAbortOnUncaughtScope no_abort_scope(realm->env());
TryCatchScope try_catch(realm->env());
Isolate::SafeForTerminationScope safe_for_termination(isolate);

bool timed_out = false;
bool received_signal = false;
Expand Down
2 changes: 1 addition & 1 deletion src/node_builtins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompileInternal(
std::string filename_s = std::string("node:") + id;
Local<String> filename =
OneByteString(isolate, filename_s.c_str(), filename_s.size());
ScriptOrigin origin(isolate, filename, 0, 0, true);
ScriptOrigin origin(filename, 0, 0, true);

BuiltinCodeCacheData cached_data{};
{
Expand Down
12 changes: 4 additions & 8 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -853,8 +853,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
host_defined_options->Set(
isolate, loader::HostDefinedOptions::kID, id_symbol);

ScriptOrigin origin(isolate,
filename,
ScriptOrigin origin(filename,
line_offset, // line offset
column_offset, // column offset
true, // is cross origin
Expand Down Expand Up @@ -973,7 +972,7 @@ MaybeLocal<Function> CompileFunction(Local<Context> context,
Local<String> filename,
Local<String> content,
std::vector<Local<String>>* parameters) {
ScriptOrigin script_origin(context->GetIsolate(), filename, 0, 0, true);
ScriptOrigin script_origin(filename, 0, 0, true);
ScriptCompiler::Source script_source(content, script_origin);

return ScriptCompiler::CompileFunction(context,
Expand Down Expand Up @@ -1083,7 +1082,6 @@ bool ContextifyScript::EvalMachine(Local<Context> context,
}

TryCatchScope try_catch(env);
Isolate::SafeForTerminationScope safe_for_termination(env->isolate());
ContextifyScript* wrapped_script;
ASSIGN_OR_RETURN_UNWRAP(&wrapped_script, args.This(), false);
Local<UnboundScript> unbound_script =
Expand Down Expand Up @@ -1237,8 +1235,7 @@ void ContextifyContext::CompileFunction(
Local<PrimitiveArray> host_defined_options =
loader::ModuleWrap::GetHostDefinedOptions(isolate, id_symbol);

ScriptOrigin origin(isolate,
filename,
ScriptOrigin origin(filename,
line_offset, // line offset
column_offset, // column offset
true, // is cross origin
Expand Down Expand Up @@ -1419,8 +1416,7 @@ static MaybeLocal<Function> CompileFunctionForCJSLoader(Environment* env,
Local<Symbol> symbol = env->vm_dynamic_import_default_internal();
Local<PrimitiveArray> hdo =
loader::ModuleWrap::GetHostDefinedOptions(isolate, symbol);
ScriptOrigin origin(isolate,
filename,
ScriptOrigin origin(filename,
0, // line offset
0, // column offset
true, // is cross origin
Expand Down
1 change: 0 additions & 1 deletion test/cctest/test_environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,6 @@ TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) {
// Allocate and initialize Isolate.
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = allocator.get();
create_params.only_terminate_in_safe_scope = true;
v8::Isolate* isolate = v8::Isolate::Allocate();
CHECK_NOT_NULL(isolate);
platform->RegisterIsolate(isolate, &current_loop);
Expand Down

0 comments on commit abd9454

Please sign in to comment.