From 6db5d4707fa341069700e1fcf0ad8830d0b4c71c Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Tue, 17 Oct 2023 14:19:34 -0700 Subject: [PATCH] Fix compilation for arm-debug --- src/node_contextify.cc | 18 ++++++++---------- src/node_contextify.h | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index e9f78d472210b4..35c628f4210d3a 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -1245,7 +1245,7 @@ void ContextifyContext::CompileFunction( TryCatchScope try_catch(env); Local result = CompileFunctionAndCacheResult(env, parsing_context, - source, + &source, params, context_extensions, options, @@ -1309,7 +1309,7 @@ ScriptCompiler::CompileOptions ContextifyContext::GetCompileOptions( Local ContextifyContext::CompileFunctionAndCacheResult( Environment* env, Local parsing_context, - const ScriptCompiler::Source& source, + ScriptCompiler::Source* source, std::vector> params, std::vector> context_extensions, ScriptCompiler::CompileOptions options, @@ -1318,7 +1318,7 @@ Local ContextifyContext::CompileFunctionAndCacheResult( const TryCatchScope& try_catch) { MaybeLocal maybe_fn = ScriptCompiler::CompileFunction( parsing_context, - const_cast(&source), + source, params.size(), params.data(), context_extensions.size(), @@ -1358,7 +1358,7 @@ Local ContextifyContext::CompileFunctionAndCacheResult( if (StoreCodeCacheResult(env, result, options, - source, + *source, produce_cached_data, std::move(new_cached_data)) .IsNothing()) { @@ -1401,11 +1401,9 @@ void ContextifyContext::ContainsModuleSyntax( // TODO(geoffreybooth): Centralize this rather than matching the logic in // cjs/loader.js and translators.js - Local id_symbol = - (String::Concat(isolate, - String::NewFromUtf8(isolate, "cjs:").ToLocalChecked(), - filename)) - .As(); + Local script_id = String::Concat( + isolate, String::NewFromUtf8(isolate, "cjs:").ToLocalChecked(), filename); + Local id_symbol = Symbol::New(isolate, script_id); Local host_defined_options = GetHostDefinedOptions(isolate, id_symbol); @@ -1424,7 +1422,7 @@ void ContextifyContext::ContainsModuleSyntax( ContextifyContext::CompileFunctionAndCacheResult(env, context, - source, + &source, params, std::vector>(), options, diff --git a/src/node_contextify.h b/src/node_contextify.h index 997e98638005bc..721c146ff88c35 100644 --- a/src/node_contextify.h +++ b/src/node_contextify.h @@ -86,7 +86,7 @@ class ContextifyContext : public BaseObject { static v8::Local CompileFunctionAndCacheResult( Environment* env, v8::Local parsing_context, - const v8::ScriptCompiler::Source& source, + v8::ScriptCompiler::Source* source, std::vector> params, std::vector> context_extensions, v8::ScriptCompiler::CompileOptions options,