Skip to content

Commit dc8bca5

Browse files
committed
src: pass parameters vector by a pointer
Refs: nodejs#48191 (comment) Signed-off-by: Darshan Sen <raisinten@gmail.com>
1 parent ee798d6 commit dc8bca5

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/node_contextify.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -940,15 +940,15 @@ MaybeLocal<Function> CompileFunction(Isolate* isolate,
940940
Local<Context> context,
941941
Local<String> filename,
942942
Local<String> content,
943-
std::vector<Local<String>> parameters) {
943+
std::vector<Local<String>>* parameters) {
944944
ScriptOrigin script_origin(isolate, filename, 0, 0, true);
945945
ScriptCompiler::Source script_source(content, script_origin);
946946

947947
Local<Function> fn;
948948
if (!ScriptCompiler::CompileFunction(context,
949949
&script_source,
950-
parameters.size(),
951-
parameters.data(),
950+
parameters->size(),
951+
parameters->data(),
952952
0,
953953
nullptr,
954954
ScriptCompiler::kEagerCompile)

src/node_contextify.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ v8::MaybeLocal<v8::Function> CompileFunction(
215215
v8::Local<v8::Context> context,
216216
v8::Local<v8::String> filename,
217217
v8::Local<v8::String> content,
218-
std::vector<v8::Local<v8::String>> parameters);
218+
std::vector<v8::Local<v8::String>>* parameters);
219219

220220
} // namespace contextify
221221
} // namespace node

src/node_sea.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ std::optional<std::string> GenerateCodeCache(std::string_view main_path,
310310

311311
Local<Function> fn;
312312
if (!contextify::CompileFunction(
313-
isolate, context, filename, content, std::move(parameters))
313+
isolate, context, filename, content, &parameters)
314314
.ToLocal(&fn)) {
315315
return std::nullopt;
316316
}

src/node_snapshotable.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ void CompileSerializeMain(const FunctionCallbackInfo<Value>& args) {
12621262
};
12631263
Local<Function> fn;
12641264
if (contextify::CompileFunction(
1265-
isolate, context, filename, source, std::move(parameters))
1265+
isolate, context, filename, source, &parameters)
12661266
.ToLocal(&fn)) {
12671267
args.GetReturnValue().Set(fn);
12681268
}

0 commit comments

Comments
 (0)