Skip to content

Commit abd9454

Browse files
authored
Remove calls to APIs deprecated in version 12.6 and removed in 12.7 (#185)
1 parent b5a7a8a commit abd9454

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

src/module_wrap.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ MaybeLocal<Module> ModuleWrap::CompileSourceTextModule(
339339
bool* cache_rejected) {
340340
Isolate* isolate = realm->isolate();
341341
EscapableHandleScope scope(isolate);
342-
ScriptOrigin origin(isolate,
343-
url,
342+
ScriptOrigin origin(url,
344343
line_offset,
345344
column_offset,
346345
true, // is cross origin
@@ -580,7 +579,6 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {
580579

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

585583
bool timed_out = false;
586584
bool received_signal = false;

src/node_builtins.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ MaybeLocal<Function> BuiltinLoader::LookupAndCompileInternal(
265265
std::string filename_s = std::string("node:") + id;
266266
Local<String> filename =
267267
OneByteString(isolate, filename_s.c_str(), filename_s.size());
268-
ScriptOrigin origin(isolate, filename, 0, 0, true);
268+
ScriptOrigin origin(filename, 0, 0, true);
269269

270270
BuiltinCodeCacheData cached_data{};
271271
{

src/node_contextify.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,7 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
853853
host_defined_options->Set(
854854
isolate, loader::HostDefinedOptions::kID, id_symbol);
855855

856-
ScriptOrigin origin(isolate,
857-
filename,
856+
ScriptOrigin origin(filename,
858857
line_offset, // line offset
859858
column_offset, // column offset
860859
true, // is cross origin
@@ -973,7 +972,7 @@ MaybeLocal<Function> CompileFunction(Local<Context> context,
973972
Local<String> filename,
974973
Local<String> content,
975974
std::vector<Local<String>>* parameters) {
976-
ScriptOrigin script_origin(context->GetIsolate(), filename, 0, 0, true);
975+
ScriptOrigin script_origin(filename, 0, 0, true);
977976
ScriptCompiler::Source script_source(content, script_origin);
978977

979978
return ScriptCompiler::CompileFunction(context,
@@ -1083,7 +1082,6 @@ bool ContextifyScript::EvalMachine(Local<Context> context,
10831082
}
10841083

10851084
TryCatchScope try_catch(env);
1086-
Isolate::SafeForTerminationScope safe_for_termination(env->isolate());
10871085
ContextifyScript* wrapped_script;
10881086
ASSIGN_OR_RETURN_UNWRAP(&wrapped_script, args.This(), false);
10891087
Local<UnboundScript> unbound_script =
@@ -1237,8 +1235,7 @@ void ContextifyContext::CompileFunction(
12371235
Local<PrimitiveArray> host_defined_options =
12381236
loader::ModuleWrap::GetHostDefinedOptions(isolate, id_symbol);
12391237

1240-
ScriptOrigin origin(isolate,
1241-
filename,
1238+
ScriptOrigin origin(filename,
12421239
line_offset, // line offset
12431240
column_offset, // column offset
12441241
true, // is cross origin
@@ -1419,8 +1416,7 @@ static MaybeLocal<Function> CompileFunctionForCJSLoader(Environment* env,
14191416
Local<Symbol> symbol = env->vm_dynamic_import_default_internal();
14201417
Local<PrimitiveArray> hdo =
14211418
loader::ModuleWrap::GetHostDefinedOptions(isolate, symbol);
1422-
ScriptOrigin origin(isolate,
1423-
filename,
1419+
ScriptOrigin origin(filename,
14241420
0, // line offset
14251421
0, // column offset
14261422
true, // is cross origin

test/cctest/test_environment.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) {
626626
// Allocate and initialize Isolate.
627627
v8::Isolate::CreateParams create_params;
628628
create_params.array_buffer_allocator = allocator.get();
629-
create_params.only_terminate_in_safe_scope = true;
630629
v8::Isolate* isolate = v8::Isolate::Allocate();
631630
CHECK_NOT_NULL(isolate);
632631
platform->RegisterIsolate(isolate, &current_loop);

0 commit comments

Comments
 (0)