explicit ContextifyContext(Environment* env, Local<Object> sandbox)
: env_(env),
sandbox_(env->isolate(), sandbox),
- context_(env->isolate(), CreateV8Context(env)),
// Wait for sandbox_, proxy_global_, and context_ to die
references_(0) {
+ context_.Reset(env->isolate(), CreateV8Context(env));
+
sandbox_.SetWeak(this, WeakCallback<Object, kSandbox>);
sandbox_.MarkIndependent();
references_++;
ContextifyContext* ctx =
Unwrap<ContextifyContext>(args.Data().As<Object>());
+ // Stil initializing
+ if (ctx->context_.IsEmpty())
+ return;
+
Local<Object> sandbox = PersistentToLocal(isolate, ctx->sandbox_);
MaybeLocal<Value> maybe_rv =
sandbox->GetRealNamedProperty(ctx->context(), property);
ContextifyContext* ctx =
Unwrap<ContextifyContext>(args.Data().As<Object>());
+ // Stil initializing
+ if (ctx->context_.IsEmpty())
+ return;
+
PersistentToLocal(isolate, ctx->sandbox_)->Set(property, value);
}
ContextifyContext* ctx =
Unwrap<ContextifyContext>(args.Data().As<Object>());
+ // Stil initializing
+ if (ctx->context_.IsEmpty())
+ return;
+
Local<Object> sandbox = PersistentToLocal(isolate, ctx->sandbox_);
Maybe<PropertyAttribute> maybe_prop_attr =
sandbox->GetRealNamedPropertyAttributes(ctx->context(), property);
ContextifyContext* ctx =
Unwrap<ContextifyContext>(args.Data().As<Object>());
+
+ // Stil initializing
+ if (ctx->context_.IsEmpty())
+ return;
+
Local<Object> sandbox = PersistentToLocal(isolate, ctx->sandbox_);
Maybe<bool> success = sandbox->Delete(ctx->context(), property);
ContextifyContext* ctx =
Unwrap<ContextifyContext>(args.Data().As<Object>());
+ // Stil initializing
+ if (ctx->context_.IsEmpty())
+ return;
+
Local<Object> sandbox = PersistentToLocal(args.GetIsolate(), ctx->sandbox_);
args.GetReturnValue().Set(sandbox->GetPropertyNames());
}