mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
src: remove calls to recently deprecated V8 APIs
Closes: https://github.com/nodejs/node/issues/52991 PR-URL: https://github.com/nodejs/node/pull/52996 Fixes: https://github.com/nodejs/node/issues/52991 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
1 parent
a619789ef0
commit
a6d54f179d
4 files changed
+14
-23
No files matched your search
+1
-3
@@ -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
|
||||
@@ -549,7 +548,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;
|
||||
|
||||
@@ -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{};
|
||||
{
|
||||
|
||||
+12
-16
@@ -886,16 +886,15 @@ void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
|
||||
host_defined_options->Set(
|
||||
isolate, loader::HostDefinedOptions::kID, id_symbol);
|
||||
|
||||
ScriptOrigin origin(isolate,
|
||||
filename,
|
||||
line_offset, // line offset
|
||||
column_offset, // column offset
|
||||
true, // is cross origin
|
||||
-1, // script id
|
||||
Local<Value>(), // source map URL
|
||||
false, // is opaque (?)
|
||||
false, // is WASM
|
||||
false, // is ES Module
|
||||
ScriptOrigin origin(filename,
|
||||
line_offset, // line offset
|
||||
column_offset, // column offset
|
||||
true, // is cross origin
|
||||
-1, // script id
|
||||
Local<Value>(), // source map URL
|
||||
false, // is opaque (?)
|
||||
false, // is WASM
|
||||
false, // is ES Module
|
||||
host_defined_options);
|
||||
ScriptCompiler::Source source(code, origin, cached_data);
|
||||
ScriptCompiler::CompileOptions compile_options =
|
||||
@@ -1006,7 +1005,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,
|
||||
@@ -1116,7 +1115,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.Holder(), false);
|
||||
Local<UnboundScript> unbound_script =
|
||||
@@ -1270,8 +1268,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
|
||||
@@ -1452,8 +1449,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
|
||||
|
||||
@@ -620,12 +620,9 @@ TEST_F(EnvironmentTest, SetImmediateMicrotasks) {
|
||||
|
||||
#ifndef _WIN32 // No SIGINT on Windows.
|
||||
TEST_F(NodeZeroIsolateTestFixture, CtrlCWithOnlySafeTerminationTest) {
|
||||
// We need to go through the whole setup dance here because we want to
|
||||
// set only_terminate_in_safe_scope.
|
||||
// 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, ¤t_loop);
|
||||
|
||||
Reference in new issue
Block a user