File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 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) {
714714 " internal/per_context/messageport" ,
715715 nullptr };
716716
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 ();
718723 for (const char ** module = context_files; *module != nullptr ; module ++) {
719724 Local<Value> arguments[] = {exports, primordials};
720725 if (builtin_loader
Original file line number Diff line number Diff line change @@ -563,7 +563,6 @@ void BuiltinLoader::GetBuiltinCategories(
563563 Local<Context> context = env->context ();
564564 Local<Object> result = Object::New (isolate);
565565
566- // Copy from the per-process categories
567566 std::set<std::string> cannot_be_required =
568567 env->builtin_loader ()->GetCannotBeRequired ();
569568 std::set<std::string> can_be_required =
You can’t perform that action at this time.
0 commit comments