diff --git a/src/node_builtins.cc b/src/node_builtins.cc index d6b5114aa3c4aa..6fa0d69b4a18e0 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc @@ -32,8 +32,6 @@ using v8::String; using v8::Undefined; using v8::Value; -BuiltinLoader BuiltinLoader::instance_; - BuiltinLoader::BuiltinLoader() : config_(GetConfig()), has_code_cache_(false) { LoadJavaScriptSource(); #ifdef NODE_SHARED_BUILTIN_CJS_MODULE_LEXER_LEXER_PATH @@ -55,6 +53,7 @@ BuiltinLoader::BuiltinLoader() : config_(GetConfig()), has_code_cache_(false) { } BuiltinLoader* BuiltinLoader::GetInstance() { + static BuiltinLoader instance_; return &instance_; } diff --git a/src/node_builtins.h b/src/node_builtins.h index f90a4151850d54..a8e880170ea148 100644 --- a/src/node_builtins.h +++ b/src/node_builtins.h @@ -136,7 +136,6 @@ class NODE_EXTERN_PRIVATE BuiltinLoader { static void AddExternalizedBuiltin(const char* id, const char* filename); - static BuiltinLoader instance_; BuiltinCategories builtin_categories_; BuiltinSourceMap source_; BuiltinCodeCacheMap code_cache_; diff --git a/test/cctest/test_per_process.cc b/test/cctest/test_per_process.cc index 1e3dff7114e337..f5bbeca5e4dd17 100644 --- a/test/cctest/test_per_process.cc +++ b/test/cctest/test_per_process.cc @@ -11,7 +11,7 @@ using node::builtins::BuiltinSourceMap; class PerProcessTest : public ::testing::Test { protected: static const BuiltinSourceMap get_sources_for_test() { - return BuiltinLoader::instance_.source_; + return BuiltinLoader::GetInstance()->source_; } };