File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -714,7 +714,12 @@ Maybe<bool> InitializePrimordials(Local<Context> context) {
714
714
" internal/per_context/messageport" ,
715
715
nullptr };
716
716
717
- auto builtin_loader = builtins::BuiltinLoader::Create ();
717
+ // We do not have access to a per-Environment BuiltinLoader instance
718
+ // at this point, because this code runs before an Environment exists
719
+ // in the first place. However, creating BuiltinLoader instances is
720
+ // relatively cheap and all the scripts that we may want to run at
721
+ // startup are always present in it.
722
+ thread_local auto builtin_loader = builtins::BuiltinLoader::Create ();
718
723
for (const char ** module = context_files; *module != nullptr ; module++) {
719
724
Local<Value> arguments[] = {exports, primordials};
720
725
if (builtin_loader
Original file line number Diff line number Diff line change @@ -563,7 +563,6 @@ void BuiltinLoader::GetBuiltinCategories(
563
563
Local<Context> context = env->context ();
564
564
Local<Object> result = Object::New (isolate);
565
565
566
- // Copy from the per-process categories
567
566
std::set<std::string> cannot_be_required =
568
567
env->builtin_loader ()->GetCannotBeRequired ();
569
568
std::set<std::string> can_be_required =
You can’t perform that action at this time.
0 commit comments