File tree Expand file tree Collapse file tree 6 files changed +10
-11
lines changed
Expand file tree Collapse file tree 6 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -897,7 +897,7 @@ v8::Local<v8::Context> Environment::context() const {
897897 return principal_realm ()->context ();
898898}
899899
900- Realm * Environment::principal_realm () const {
900+ PrincipalRealm * Environment::principal_realm () const {
901901 return principal_realm_.get ();
902902}
903903
Original file line number Diff line number Diff line change @@ -886,7 +886,7 @@ class Environment final : public MemoryRetainer {
886886 // Get the context with an explicit realm instead when possible.
887887 // Deprecate soon.
888888 inline v8::Local<v8::Context> context () const ;
889- inline Realm * principal_realm () const ;
889+ inline PrincipalRealm * principal_realm () const ;
890890
891891#if HAVE_INSPECTOR
892892 inline inspector::Agent* inspector_agent () const {
Original file line number Diff line number Diff line change @@ -2391,10 +2391,9 @@ static void WriteBuffers(const FunctionCallbackInfo<Value>& args) {
23912391
23922392 MaybeStackBuffer<uv_buf_t > iovs (chunks->Length ());
23932393
2394- Local<Context> context = env->context ();
23952394 for (uint32_t i = 0 ; i < iovs.length (); i++) {
23962395 Local<Value> chunk;
2397- if (!chunks->Get (context, i).ToLocal (&chunk)) return ;
2396+ if (!chunks->Get (env-> context () , i).ToLocal (&chunk)) return ;
23982397 CHECK (Buffer::HasInstance (chunk));
23992398 iovs[i] = uv_buf_init (Buffer::Data (chunk), Buffer::Length (chunk));
24002399 }
@@ -2777,10 +2776,9 @@ static void ReadBuffers(const FunctionCallbackInfo<Value>& args) {
27772776 MaybeStackBuffer<uv_buf_t > iovs (buffers->Length ());
27782777
27792778 // Init uv buffers from ArrayBufferViews
2780- Local<Context> context = env->context ();
27812779 for (uint32_t i = 0 ; i < iovs.length (); i++) {
27822780 Local<Value> buffer;
2783- if (!buffers->Get (context, i).ToLocal (&buffer)) return ;
2781+ if (!buffers->Get (env-> context () , i).ToLocal (&buffer)) return ;
27842782 CHECK (Buffer::HasInstance (buffer));
27852783 iovs[i] = uv_buf_init (Buffer::Data (buffer), Buffer::Length (buffer));
27862784 }
Original file line number Diff line number Diff line change 55
66#include " node_context_data.h"
77#include " node_realm.h"
8+ #include " util-inl.h"
89
910namespace node {
1011
@@ -46,6 +47,10 @@ inline v8::Isolate* Realm::isolate() const {
4647 return isolate_;
4748}
4849
50+ inline v8::Local<v8::Context> Realm::context () const {
51+ return PersistentToLocal::Strong (context_);
52+ }
53+
4954inline Realm::Kind Realm::kind () const {
5055 return kind_;
5156}
Original file line number Diff line number Diff line change @@ -295,10 +295,6 @@ void Realm::VerifyNoStrongBaseObjects() {
295295 });
296296}
297297
298- v8::Local<v8::Context> Realm::context () const {
299- return PersistentToLocal::Strong (context_);
300- }
301-
302298// Per-realm strong value accessors. The per-realm values should avoid being
303299// accessed across realms.
304300#define V (PropertyName, TypeName ) \
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ class Realm : public MemoryRetainer {
121121 inline Environment* env () const ;
122122 inline v8::Isolate* isolate () const ;
123123 inline Kind kind () const ;
124- virtual v8::Local<v8::Context> context () const ;
124+ inline virtual v8::Local<v8::Context> context () const ;
125125 inline bool has_run_bootstrapping_code () const ;
126126
127127 // Methods created using SetMethod(), SetPrototypeMethod(), etc. inside
You can’t perform that action at this time.
0 commit comments