mirror of
https://github.com/phpv8/v8js.git
synced 2024-12-22 14:01:53 +00:00
Use v8::Isolate version of v8::Context::New
This commit is contained in:
parent
a17b3c47a0
commit
6eeb6fe9d6
6
v8js.cc
6
v8js.cc
@ -231,15 +231,13 @@ static HashTable *php_v8js_v8_get_properties(zval *object TSRMLS_DC) /* {{{ */
|
||||
v8::Locker locker(obj->isolate);
|
||||
v8::Isolate::Scope isolate_scope(obj->isolate);
|
||||
v8::HandleScope local_scope(obj->isolate);
|
||||
v8::Persistent<v8::Context> temp_context = v8::Context::New();
|
||||
v8::Local<v8::Context> temp_context = v8::Context::New(obj->isolate);
|
||||
v8::Context::Scope temp_scope(temp_context);
|
||||
|
||||
if (php_v8js_v8_get_properties_hash(obj->v8obj, retval, obj->flags, obj->isolate TSRMLS_CC) == SUCCESS) {
|
||||
temp_context.Dispose();
|
||||
return retval;
|
||||
}
|
||||
|
||||
temp_context.Dispose();
|
||||
return NULL;
|
||||
}
|
||||
/* }}} */
|
||||
@ -596,7 +594,7 @@ static PHP_METHOD(V8Js, __construct)
|
||||
php_v8js_register_methods(c->global_template->InstanceTemplate(), c);
|
||||
|
||||
/* Create context */
|
||||
c->context = v8::Context::New(&extension_conf, c->global_template->InstanceTemplate());
|
||||
c->context = v8::Persistent<v8::Context>::New(v8::Context::New(c->isolate, &extension_conf, c->global_template->InstanceTemplate()));
|
||||
c->context->SetAlignedPointerInEmbedderData(1, c);
|
||||
|
||||
if (exts) {
|
||||
|
@ -272,7 +272,7 @@ V8JS_METHOD(require)
|
||||
global->Set(v8::String::New("module"), module);
|
||||
|
||||
// Each module gets its own context so different modules do not affect each other
|
||||
v8::Persistent<v8::Context> context = v8::Context::New(NULL, global);
|
||||
v8::Persistent<v8::Context> context = v8::Persistent<v8::Context>::New(v8::Context::New(c->isolate, NULL, global));
|
||||
|
||||
// Catch JS exceptions
|
||||
v8::TryCatch try_catch;
|
||||
|
Loading…
Reference in New Issue
Block a user