Skip to content

Commit d750a3c

Browse files
ajkleintargos
authored andcommitted
src: remove calls to recently deprecated V8 APIs
Closes: #52991 PR-URL: #52996 Fixes: #52991 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]>
1 parent c70b2f7 commit d750a3c

File tree

4 files changed

+14
-23
lines changed

4 files changed

+14
-23
lines changed

src/module_wrap.cc

+1-3
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
@@ -549,7 +548,6 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo<Value>& args) {
549548

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

554552
bool timed_out = false;
555553
bool received_signal = false;

src/node_builtins.cc

+1-1
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

+12-16
Original file line numberDiff line numberDiff line change
@@ -886,16 +886,15 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
886886
host_defined_options->Set(
887887
isolate, loader::HostDefinedOptions::kID, id_symbol);
888888

889-
ScriptOrigin origin(isolate,
890-
filename,
891-
line_offset, // line offset
892-
column_offset, // column offset
893-
true, // is cross origin
894-
-1, // script id
895-
Local<Value>(), // source map URL
896-
false, // is opaque (?)
897-
false, // is WASM
898-
false, // is ES Module
889+
ScriptOrigin origin(filename,
890+
line_offset, // line offset
891+
column_offset, // column offset
892+
true, // is cross origin
893+
-1, // script id
894+
Local<Value>(), // source map URL
895+
false, // is opaque (?)
896+
false, // is WASM
897+
false, // is ES Module
899898
host_defined_options);
900899
ScriptCompiler::Source source(code, origin, cached_data);
901900
ScriptCompiler::CompileOptions compile_options =
@@ -1006,7 +1005,7 @@ MaybeLocal<Function> CompileFunction(Local<Context> context,
10061005
Local<String> filename,
10071006
Local<String> content,
10081007
std::vector<Local<String>>* parameters) {
1009-
ScriptOrigin script_origin(context->GetIsolate(), filename, 0, 0, true);
1008+
ScriptOrigin script_origin(filename, 0, 0, true);
10101009
ScriptCompiler::Source script_source(content, script_origin);
10111010

10121011
return ScriptCompiler::CompileFunction(context,
@@ -1116,7 +1115,6 @@ bool ContextifyScript::EvalMachine(Local<Context> context,
11161115
}
11171116

11181117
TryCatchScope try_catch(env);
1119-
Isolate::SafeForTerminationScope safe_for_termination(env->isolate());
11201118
ContextifyScript* wrapped_script;
11211119
ASSIGN_OR_RETURN_UNWRAP(&wrapped_script, args.Holder(), false);
11221120
Local<UnboundScript> unbound_script =
@@ -1270,8 +1268,7 @@ void ContextifyContext::CompileFunction(
12701268
Local<PrimitiveArray> host_defined_options =
12711269
loader::ModuleWrap::GetHostDefinedOptions(isolate, id_symbol);
12721270

1273-
ScriptOrigin origin(isolate,
1274-
filename,
1271+
ScriptOrigin origin(filename,
12751272
line_offset, // line offset
12761273
column_offset, // column offset
12771274
true, // is cross origin
@@ -1452,8 +1449,7 @@ static MaybeLocal<Function> CompileFunctionForCJSLoader(Environment* env,
14521449
Local<Symbol> symbol = env->vm_dynamic_import_default_internal();
14531450
Local<PrimitiveArray> hdo =
14541451
loader::ModuleWrap::GetHostDefinedOptions(isolate, symbol);
1455-
ScriptOrigin origin(isolate,
1456-
filename,
1452+
ScriptOrigin origin(filename,
14571453
0, // line offset
14581454
0, // column offset
14591455
true, // is cross origin

test/cctest/test_environment.cc

-3
Original file line numberDiff line numberDiff line change
@@ -620,12 +620,9 @@ TEST_F(EnvironmentTest, SetImmediateMicrotasks) {
620620

621621
#ifndef _WIN32 // No SIGINT on Windows.
622622
TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) {
623-
// We need to go through the whole setup dance here because we want to
624-
// set only_terminate_in_safe_scope.
625623
// Allocate and initialize Isolate.
626624
v8::Isolate::CreateParams create_params;
627625
create_params.array_buffer_allocator = allocator.get();
628-
create_params.only_terminate_in_safe_scope = true;
629626
v8::Isolate* isolate = v8::Isolate::Allocate();
630627
CHECK_NOT_NULL(isolate);
631628
platform->RegisterIsolate(isolate, &current_loop);

0 commit comments

Comments
 (0)