@@ -1165,7 +1165,7 @@ Maybe<void> StoreCodeCacheResult(
1165
1165
MaybeLocal<Function> CompileFunction (Local<Context> context,
1166
1166
Local<String> filename,
1167
1167
Local<String> content,
1168
- std::vector<Local< String> >* parameters) {
1168
+ LocalVector< String>* parameters) {
1169
1169
ScriptOrigin script_origin (filename, 0 , 0 , true );
1170
1170
ScriptCompiler::Source script_source (content, script_origin);
1171
1171
@@ -1474,7 +1474,7 @@ void ContextifyContext::CompileFunction(
1474
1474
Context::Scope scope (parsing_context);
1475
1475
1476
1476
// Read context extensions from buffer
1477
- std::vector<Local< Object>> context_extensions;
1477
+ LocalVector< Object> context_extensions (isolate) ;
1478
1478
if (!context_extensions_buf.IsEmpty ()) {
1479
1479
for (uint32_t n = 0 ; n < context_extensions_buf->Length (); n++) {
1480
1480
Local<Value> val;
@@ -1485,7 +1485,7 @@ void ContextifyContext::CompileFunction(
1485
1485
}
1486
1486
1487
1487
// Read params from params buffer
1488
- std::vector<Local< String>> params;
1488
+ LocalVector< String> params (isolate) ;
1489
1489
if (!params_buf.IsEmpty ()) {
1490
1490
for (uint32_t n = 0 ; n < params_buf->Length (); n++) {
1491
1491
Local<Value> val;
@@ -1517,22 +1517,24 @@ void ContextifyContext::CompileFunction(
1517
1517
args.GetReturnValue ().Set (result);
1518
1518
}
1519
1519
1520
- static std::vector<Local<String>> GetCJSParameters (IsolateData* data) {
1521
- return {
1522
- data->exports_string (),
1523
- data->require_string (),
1524
- data->module_string (),
1525
- data->__filename_string (),
1526
- data->__dirname_string (),
1527
- };
1520
+ static LocalVector<String> GetCJSParameters (IsolateData* data) {
1521
+ LocalVector<String> result (data->isolate (),
1522
+ {
1523
+ data->exports_string (),
1524
+ data->require_string (),
1525
+ data->module_string (),
1526
+ data->__filename_string (),
1527
+ data->__dirname_string (),
1528
+ });
1529
+ return result;
1528
1530
}
1529
1531
1530
1532
Local<Object> ContextifyContext::CompileFunctionAndCacheResult (
1531
1533
Environment* env,
1532
1534
Local<Context> parsing_context,
1533
1535
ScriptCompiler::Source* source,
1534
- std::vector<Local< String> > params,
1535
- std::vector<Local< Object> > context_extensions,
1536
+ LocalVector< String> params,
1537
+ LocalVector< Object> context_extensions,
1536
1538
ScriptCompiler::CompileOptions options,
1537
1539
bool produce_cached_data,
1538
1540
Local<Symbol> id_symbol,
@@ -1668,7 +1670,7 @@ static MaybeLocal<Function> CompileFunctionForCJSLoader(
1668
1670
options = ScriptCompiler::kConsumeCodeCache ;
1669
1671
}
1670
1672
1671
- std::vector<Local< String>> params;
1673
+ LocalVector< String> params (isolate) ;
1672
1674
if (is_cjs_scope) {
1673
1675
params = GetCJSParameters (env->isolate_data ());
1674
1676
}
0 commit comments