diff --git a/deps/chakrashim/include/v8.h b/deps/chakrashim/include/v8.h index cb47aa9d407..4b67ce872d6 100644 --- a/deps/chakrashim/include/v8.h +++ b/deps/chakrashim/include/v8.h @@ -684,6 +684,11 @@ class Global : public PersistentBase { other._weakWrapper = nullptr; } + template + static Global New(Isolate* isolate, Local that) { + return Global(isolate, that); + } + V8_INLINE ~Global() { this->Reset(); } template diff --git a/src/env-inl.h b/src/env-inl.h index b7c6fb4f4b4..dded0cf4350 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -389,7 +389,7 @@ inline v8::Local Environment::fs_stats_field_array() const { inline void Environment::set_fs_stats_field_array(v8::Local fields) { CHECK_EQ(fs_stats_field_array_.IsEmpty(), true); // Should be set only once. - fs_stats_field_array_ = v8::Global::Global(isolate_, fields); + fs_stats_field_array_ = v8::Global::New(isolate_, fields); } inline Environment* Environment::from_cares_timer_handle(uv_timer_t* handle) {