0
0
mirror of https://github.com/phpv8/v8js.git synced 2025-03-11 22:18:44 +00:00

Make compatible with V8 3.23.8 (and below)

This commit is contained in:
Stefan Siegl 2013-12-21 20:01:46 +01:00
parent e20e5098c7
commit 1e773dd4a8
3 changed files with 16 additions and 1 deletions

View File

@ -187,7 +187,12 @@ struct php_v8js_ctx {
/* }}} */
#ifdef ZTS
# define V8JS_TSRMLS_FETCH() TSRMLS_FETCH_FROM_CTX(((php_v8js_ctx *) isolate->GetData(0))->zts_ctx);
# if PHP_V8_API_VERSION <= 3023008
/* Until V8 3.23.8 Isolate could only take one external pointer. */
# define V8JS_TSRMLS_FETCH() TSRMLS_FETCH_FROM_CTX(((php_v8js_ctx *) isolate->GetData())->zts_ctx);
# else
# define V8JS_TSRMLS_FETCH() TSRMLS_FETCH_FROM_CTX(((php_v8js_ctx *) isolate->GetData(0))->zts_ctx);
# endif
#else
# define V8JS_TSRMLS_FETCH()
#endif

View File

@ -779,7 +779,12 @@ static PHP_METHOD(V8Js, __construct)
c->pending_exception = NULL;
c->in_execution = 0;
c->isolate = v8::Isolate::New();
#if PHP_V8_API_VERSION <= 3023008
/* Until V8 3.23.8 Isolate could only take one external pointer. */
c->isolate->SetData(c);
#else
c->isolate->SetData(0, c);
#endif
c->time_limit_hit = false;
c->memory_limit_hit = false;
c->module_loader = NULL;

View File

@ -686,7 +686,12 @@ static v8::Handle<v8::Value> php_v8js_hash_to_jsobj(zval *value, v8::Isolate *is
return v8obj;
} else if (ce) {
#if PHP_V8_API_VERSION <= 3023008
/* Until V8 3.23.8 Isolate could only take one external pointer. */
php_v8js_ctx *ctx = (php_v8js_ctx *) isolate->GetData();
#else
php_v8js_ctx *ctx = (php_v8js_ctx *) isolate->GetData(0);
#endif
v8::Local<v8::FunctionTemplate> new_tpl;
v8js_tmpl_t *persist_tpl_;