Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commited986f9

Browse files
committed
fixup! fixup! fixup! fixup! fixup! src: make BuiltinLoader threadsafe and non-global
1 parent93e411a commited986f9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎src/api/environment.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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_localauto builtin_loader =builtins::BuiltinLoader::Create();
718723
for (constchar**module = context_files; *module !=nullptr;module++) {
719724
Local<Value> arguments[] = {exports, primordials};
720725
if (builtin_loader

‎src/node_builtins.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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 =

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp