0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 20:51:51 +00:00

Use v8::Isolate version of v8::Context::New

This commit is contained in:
Stefan Siegl 2013-07-07 22:36:56 +02:00
parent a17b3c47a0
commit 6eeb6fe9d6
2 changed files with 3 additions and 5 deletions

View File

@ -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) {

View File

@ -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;