Skip to content

Commit

Permalink
Fix compilation for arm-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffreyBooth committed Oct 18, 2023
1 parent a918902 commit 6db5d47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ void ContextifyContext::CompileFunction(
TryCatchScope try_catch(env);
Local<Object> result = CompileFunctionAndCacheResult(env,
parsing_context,
source,
&source,
params,
context_extensions,
options,
Expand Down Expand Up @@ -1309,7 +1309,7 @@ ScriptCompiler::CompileOptions ContextifyContext::GetCompileOptions(
Local<Object> ContextifyContext::CompileFunctionAndCacheResult(
Environment* env,
Local<Context> parsing_context,
const ScriptCompiler::Source& source,
ScriptCompiler::Source* source,
std::vector<Local<String>> params,
std::vector<Local<Object>> context_extensions,
ScriptCompiler::CompileOptions options,
Expand All @@ -1318,7 +1318,7 @@ Local<Object> ContextifyContext::CompileFunctionAndCacheResult(
const TryCatchScope& try_catch) {
MaybeLocal<Function> maybe_fn = ScriptCompiler::CompileFunction(
parsing_context,
const_cast<ScriptCompiler::Source*>(&source),
source,
params.size(),
params.data(),
context_extensions.size(),
Expand Down Expand Up @@ -1358,7 +1358,7 @@ Local<Object> ContextifyContext::CompileFunctionAndCacheResult(
if (StoreCodeCacheResult(env,
result,
options,
source,
*source,
produce_cached_data,
std::move(new_cached_data))
.IsNothing()) {
Expand Down Expand Up @@ -1401,11 +1401,9 @@ void ContextifyContext::ContainsModuleSyntax(

// TODO(geoffreybooth): Centralize this rather than matching the logic in
// cjs/loader.js and translators.js
Local<Symbol> id_symbol =
(String::Concat(isolate,
String::NewFromUtf8(isolate, "cjs:").ToLocalChecked(),
filename))
.As<Symbol>();
Local<String> script_id = String::Concat(
isolate, String::NewFromUtf8(isolate, "cjs:").ToLocalChecked(), filename);
Local<Symbol> id_symbol = Symbol::New(isolate, script_id);

Local<PrimitiveArray> host_defined_options =
GetHostDefinedOptions(isolate, id_symbol);
Expand All @@ -1424,7 +1422,7 @@ void ContextifyContext::ContainsModuleSyntax(

ContextifyContext::CompileFunctionAndCacheResult(env,
context,
source,
&source,
params,
std::vector<Local<Object>>(),
options,
Expand Down
2 changes: 1 addition & 1 deletion src/node_contextify.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ContextifyContext : public BaseObject {
static v8::Local<v8::Object> CompileFunctionAndCacheResult(
Environment* env,
v8::Local<v8::Context> parsing_context,
const v8::ScriptCompiler::Source& source,
v8::ScriptCompiler::Source* source,
std::vector<v8::Local<v8::String>> params,
std::vector<v8::Local<v8::Object>> context_extensions,
v8::ScriptCompiler::CompileOptions options,
Expand Down

0 comments on commit 6db5d47

Please sign in to comment.