diff --git a/src/node_contextify.cc b/src/node_contextify.cc index e9f78d472210b4..a3ce27d0d4062f 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()) { @@ -1424,7 +1424,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,