@@ -1245,7 +1245,7 @@ void ContextifyContext::CompileFunction(
1245
1245
TryCatchScope try_catch (env);
1246
1246
Local<Object> result = CompileFunctionAndCacheResult (env,
1247
1247
parsing_context,
1248
- source,
1248
+ & source,
1249
1249
params,
1250
1250
context_extensions,
1251
1251
options,
@@ -1309,7 +1309,7 @@ ScriptCompiler::CompileOptions ContextifyContext::GetCompileOptions(
1309
1309
Local<Object> ContextifyContext::CompileFunctionAndCacheResult (
1310
1310
Environment* env,
1311
1311
Local<Context> parsing_context,
1312
- const ScriptCompiler::Source& source,
1312
+ ScriptCompiler::Source* source,
1313
1313
std::vector<Local<String>> params,
1314
1314
std::vector<Local<Object>> context_extensions,
1315
1315
ScriptCompiler::CompileOptions options,
@@ -1318,7 +1318,7 @@ Local<Object> ContextifyContext::CompileFunctionAndCacheResult(
1318
1318
const TryCatchScope& try_catch) {
1319
1319
MaybeLocal<Function> maybe_fn = ScriptCompiler::CompileFunction (
1320
1320
parsing_context,
1321
- const_cast <ScriptCompiler::Source*>(& source) ,
1321
+ source,
1322
1322
params.size (),
1323
1323
params.data (),
1324
1324
context_extensions.size (),
@@ -1358,7 +1358,7 @@ Local<Object> ContextifyContext::CompileFunctionAndCacheResult(
1358
1358
if (StoreCodeCacheResult (env,
1359
1359
result,
1360
1360
options,
1361
- source,
1361
+ * source,
1362
1362
produce_cached_data,
1363
1363
std::move (new_cached_data))
1364
1364
.IsNothing ()) {
@@ -1401,11 +1401,9 @@ void ContextifyContext::ContainsModuleSyntax(
1401
1401
1402
1402
// TODO(geoffreybooth): Centralize this rather than matching the logic in
1403
1403
// cjs/loader.js and translators.js
1404
- Local<Symbol> id_symbol =
1405
- (String::Concat (isolate,
1406
- String::NewFromUtf8 (isolate, " cjs:" ).ToLocalChecked (),
1407
- filename))
1408
- .As <Symbol>();
1404
+ Local<String> script_id = String::Concat (
1405
+ isolate, String::NewFromUtf8 (isolate, " cjs:" ).ToLocalChecked (), filename);
1406
+ Local<Symbol> id_symbol = Symbol::New (isolate, script_id);
1409
1407
1410
1408
Local<PrimitiveArray> host_defined_options =
1411
1409
GetHostDefinedOptions (isolate, id_symbol);
@@ -1424,7 +1422,7 @@ void ContextifyContext::ContainsModuleSyntax(
1424
1422
1425
1423
ContextifyContext::CompileFunctionAndCacheResult (env,
1426
1424
context,
1427
- source,
1425
+ & source,
1428
1426
params,
1429
1427
std::vector<Local<Object>>(),
1430
1428
options,
0 commit comments