}
inline Local<Object> object() {
- return PersistentToLocal(persistent());
+ return PersistentToLocal(node_isolate, persistent());
}
protected:
if (using_domains) return;
HandleScope scope(node_isolate);
using_domains = true;
- Local<Object> process = PersistentToLocal(process_p);
+ Local<Object> process = PersistentToLocal(node_isolate, process_p);
Local<Value> tdc_v = process->Get(String::New("_tickDomainCallback"));
Local<Value> ndt_v = process->Get(String::New("_nextDomainTick"));
if (!tdc_v->IsFunction()) {
}
// process nextTicks after call
- Local<Object> process = PersistentToLocal(process_p);
- Local<Function> fn = PersistentToLocal(process_tickCallback);
+ Local<Object> process = PersistentToLocal(node_isolate, process_p);
+ Local<Function> fn = PersistentToLocal(node_isolate, process_tickCallback);
fn->Call(process, 0, NULL);
if (try_catch.HasCaught()) {
int argc,
Handle<Value> argv[]) {
// TODO(trevnorris) Hook for long stack traces to be made here.
- Local<Object> process = PersistentToLocal(process_p);
+ Local<Object> process = PersistentToLocal(node_isolate, process_p);
if (using_domains)
return MakeDomainCallback(object, callback, argc, argv);
}
// process nextTicks after call
- Local<Function> fn = PersistentToLocal(process_tickCallback);
+ Local<Function> fn = PersistentToLocal(node_isolate, process_tickCallback);
fn->Call(process, 0, NULL);
if (try_catch.HasCaught()) {
if (fatal_exception_symbol.IsEmpty())
fatal_exception_symbol = String::New("_fatalException");
- Local<Object> process = PersistentToLocal(process_p);
+ Local<Object> process = PersistentToLocal(node_isolate, process_p);
Local<Value> fatal_v = process->Get(fatal_exception_symbol);
if (!fatal_v->IsFunction()) {
String::Utf8Value module_v(module);
node_module_struct* modp;
- Local<Object> cache = PersistentToLocal(binding_cache);
+ Local<Object> cache = PersistentToLocal(node_isolate, binding_cache);
Local<Object> exports;
if (cache->Has(module)) {
char buf[1024];
snprintf(buf, sizeof(buf), "Binding %s", *module_v);
- Local<Array> modules = PersistentToLocal(module_load_list);
+ Local<Array> modules = PersistentToLocal(node_isolate, module_load_list);
uint32_t l = modules->Length();
modules->Set(l, String::New(buf));
*data = reinterpret_cast<const unsigned char*>("");
*len = 0;
} else {
- Local<Object> obj = PersistentToLocal(p->npnProtos_);
+ Local<Object> obj = PersistentToLocal(node_isolate, p->npnProtos_);
*data = reinterpret_cast<const unsigned char*>(Buffer::Data(obj));
*len = Buffer::Length(obj);
}
return SSL_TLSEXT_ERR_OK;
}
- Local<Object> obj = PersistentToLocal(p->npnProtos_);
+ Local<Object> obj = PersistentToLocal(node_isolate, p->npnProtos_);
const unsigned char* npnProtos =
reinterpret_cast<const unsigned char*>(Buffer::Data(obj));
if (!p->sniObject_.IsEmpty()) {
p->sniContext_.Dispose();
- Local<Value> arg = PersistentToLocal(p->servername_);
+ Local<Value> arg = PersistentToLocal(node_isolate, p->servername_);
Local<Value> ret = MakeCallback(p->sniObject_, "onselect", 1, &arg);
// If ret is SecureContext
ctime_symbol = String::New("ctime");
}
- Local<Function> constructor = PersistentToLocal(stats_constructor);
+ Local<Function> constructor =
+ PersistentToLocal(node_isolate, stats_constructor);
Local<Object> stats = constructor->NewInstance();
if (stats.IsEmpty()) return Local<Object>();
// reference to the object.
template <class TypeName>
inline v8::Local<TypeName> PersistentToLocal(
- const v8::Persistent<TypeName>& persistent);
-
-// If persistent.IsWeak() == false, then do not call persistent.Dispose()
-// while the returned Local<T> is still in scope, it will destroy the
-// reference to the object.
-template <class TypeName>
-inline v8::Local<TypeName> PersistentToLocal(
v8::Isolate* isolate,
const v8::Persistent<TypeName>& persistent);
Local<Object> WrappedContext::NewInstance() {
Local<FunctionTemplate> constructor_template_handle =
- PersistentToLocal(constructor_template);
+ PersistentToLocal(node_isolate, constructor_template);
return constructor_template_handle->GetFunction()->NewInstance();
}
if (using_alloc_cb && obj->Has(smalloc_sym)) {
Local<External> ext = obj->GetHiddenValue(smalloc_sym).As<External>();
CallbackInfo* cb_info = static_cast<CallbackInfo*>(ext->Value());
- Local<Object> obj = PersistentToLocal(cb_info->p_obj);
+ Local<Object> obj = PersistentToLocal(node_isolate, cb_info->p_obj);
TargetFreeCallback(node_isolate, obj, cb_info);
return;
}
*data = reinterpret_cast<const unsigned char*>("");
*len = 0;
} else {
- Local<Object> obj = PersistentToLocal(p->npn_protos_);
+ Local<Object> obj = PersistentToLocal(node_isolate, p->npn_protos_);
*data = reinterpret_cast<const unsigned char*>(Buffer::Data(obj));
*len = Buffer::Length(obj);
}
return SSL_TLSEXT_ERR_OK;
}
- Local<Object> obj = PersistentToLocal(p->npn_protos_);
+ Local<Object> obj = PersistentToLocal(node_isolate, p->npn_protos_);
const unsigned char* npn_protos =
reinterpret_cast<const unsigned char*>(Buffer::Data(obj));
size_t len = Buffer::Length(obj);
if (object->Has(onsniselect_sym)) {
p->sni_context_.Dispose();
- Local<Value> arg = PersistentToLocal(p->servername_);
+ Local<Value> arg = PersistentToLocal(node_isolate, p->servername_);
Handle<Value> ret = MakeCallback(object, onsniselect_sym, 1, &arg);
// If ret is SecureContext