Skip to content

Commit e648f43

Browse files
waqasmanistesie
authored andcommitted
all test passed v8 8.9
1 parent 0eec3bd commit e648f43

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

config.m4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ if test "$PHP_V8JS" != "no"; then
4848
CPPFLAGS=$old_CPPFLAGS
4949
]);
5050

51-
AC_CACHE_CHECK(how to allow c++11 narrowing, ac_cv_v8_narrowing, [
51+
AC_CACHE_CHECK(how to allow c++14 narrowing, ac_cv_v8_narrowing, [
5252
ac_cv_v8_narrowing=""
5353
old_CXXFLAGS=$CXXFLAGS
5454
AC_LANG_PUSH([C++])
@@ -58,12 +58,12 @@ if test "$PHP_V8JS" != "no"; then
5858
(void) foo;
5959
return 0;
6060
}]])],[ac_cv_v8_narrowing=""],[
61-
CXXFLAGS="-Wno-c++11-narrowing -std="$ac_cv_v8_cstd
61+
CXXFLAGS="-Wno-c++14-narrowing -std="$ac_cv_v8_cstd
6262
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() {
6363
struct { unsigned int x; } foo = {-1};
6464
(void) foo;
6565
return 0;
66-
}]])],[ac_cv_v8_narrowing="-Wno-c++11-narrowing"],[
66+
}]])],[ac_cv_v8_narrowing="-Wno-c++14-narrowing"],[
6767
CXXFLAGS="-Wno-narrowing -std="$ac_cv_v8_cstd
6868
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() {
6969
struct { unsigned int x; } foo = {-1};

v8js_array_access.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,11 @@ void v8js_array_access_enumerator(const v8::PropertyCallbackInfo<v8::Array>& inf
210210

211211
for(int j = 0; j < length; j ++) {
212212
if(v8js_array_access_isset_p(object, j)) {
213-
result->Set(isolate->GetEnteredContext(), i ++, V8JS_INT(j));
213+
result->Set(isolate->GetEnteredOrMicrotaskContext(), i ++, V8JS_INT(j));
214214
}
215215
}
216216

217-
result->Set(isolate->GetEnteredContext(), V8JS_SYM("length"), V8JS_INT(i));
217+
result->Set(isolate->GetEnteredOrMicrotaskContext(), V8JS_SYM("length"), V8JS_INT(i));
218218
info.GetReturnValue().Set(result);
219219
}
220220
/* }}} */
@@ -245,12 +245,12 @@ void v8js_array_access_named_getter(v8::Local<v8::Name> property_name, const v8:
245245
}
246246

247247
v8::Local<v8::Object> prototype_object;
248-
if(!prototype->ToObject(isolate->GetEnteredContext()).ToLocal(&prototype_object)) {
248+
if(!prototype->ToObject(isolate->GetEnteredOrMicrotaskContext()).ToLocal(&prototype_object)) {
249249
/* ehh? Array.prototype not an object? strange, stop. */
250250
info.GetReturnValue().Set(ret_value);
251251
}
252252

253-
prototype_object->Get(isolate->GetEnteredContext(), property).ToLocal(&ret_value);
253+
prototype_object->Get(isolate->GetEnteredOrMicrotaskContext(), property).ToLocal(&ret_value);
254254
}
255255

256256
info.GetReturnValue().Set(ret_value);

v8js_convert.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static v8::Local<v8::Value> v8js_hash_to_jsarr(zval *value, v8::Isolate *isolate
7979
return V8JS_NULL;
8080
}
8181

82-
v8::Local<v8::Context> v8_context = isolate->GetEnteredContext();
82+
v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext();
8383
newarr = v8::Array::New(isolate, i);
8484

8585
if (i > 0)
@@ -149,7 +149,7 @@ v8::Local<v8::Value> zval_to_v8js(zval *value, v8::Isolate *isolate) /* {{{ */
149149
if (instanceof_function(Z_OBJCE_P(value), ce)) {
150150
zval dtval;
151151
zend_call_method_with_0_params(value, NULL, NULL, "getTimestamp", &dtval);
152-
v8::Date::New(isolate->GetEnteredContext(), ((double)Z_LVAL(dtval) * 1000.0)).ToLocal(&jsValue);
152+
v8::Date::New(isolate->GetEnteredOrMicrotaskContext(), ((double)Z_LVAL(dtval) * 1000.0)).ToLocal(&jsValue);
153153
zval_dtor(&dtval);
154154
} else
155155
jsValue = v8js_hash_to_jsobj(value, isolate);

v8js_methods.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ V8JS_METHOD(require)
488488
}
489489

490490
if(Z_TYPE(module_code) == IS_OBJECT) {
491-
v8::Local<v8::Object> newobj = zval_to_v8js(&module_code, isolate)->ToObject(isolate->GetEnteredContext()).ToLocalChecked();
491+
v8::Local<v8::Object> newobj = zval_to_v8js(&module_code, isolate)->ToObject(isolate->GetEnteredOrMicrotaskContext()).ToLocalChecked();
492492
c->modules_loaded[normalised_module_id].Reset(isolate, newobj);
493493
info.GetReturnValue().Set(newobj);
494494

v8js_object_export.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static void v8js_weak_object_callback(const v8::WeakCallbackInfo<zend_object> &d
3838
static void v8js_call_php_func(zend_object *object, zend_function *method_ptr, const v8::FunctionCallbackInfo<v8::Value>& info) /* {{{ */
3939
{
4040
v8::Isolate *isolate = info.GetIsolate();
41-
v8::Local<v8::Context> v8_context = isolate->GetEnteredContext();
41+
v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext();
4242
v8::Local<v8::Value> return_value = V8JS_NULL;
4343
zend_fcall_info fci;
4444
zend_fcall_info_cache fcc;
@@ -231,8 +231,8 @@ static void v8js_construct_callback(const v8::FunctionCallbackInfo<v8::Value>& i
231231
v8::Local<v8::Array> cons_data = v8::Local<v8::Array>::Cast(info.Data());
232232
v8::Local<v8::Value> cons_tmpl, cons_ce;
233233

234-
if (!cons_data->Get(isolate->GetEnteredContext(), 0).ToLocal(&cons_tmpl)
235-
||!cons_data->Get(isolate->GetEnteredContext(), 1).ToLocal(&cons_ce))
234+
if (!cons_data->Get(isolate->GetEnteredOrMicrotaskContext(), 0).ToLocal(&cons_tmpl)
235+
||!cons_data->Get(isolate->GetEnteredOrMicrotaskContext(), 1).ToLocal(&cons_ce))
236236
{
237237
return;
238238
}
@@ -328,14 +328,14 @@ static void v8js_weak_closure_callback(const v8::WeakCallbackInfo<v8js_function_
328328
!strncasecmp(ZSTR_VAL(key), mname, ZSTR_LEN(key)))
329329

330330
#define PHP_V8JS_CALLBACK(isolate, mptr, tmpl) \
331-
(v8::FunctionTemplate::New((isolate), v8js_php_callback, v8::External::New((isolate), mptr), v8::Signature::New((isolate), tmpl))->GetFunction(isolate->GetEnteredContext()).ToLocalChecked())
331+
(v8::FunctionTemplate::New((isolate), v8js_php_callback, v8::External::New((isolate), mptr), v8::Signature::New((isolate), tmpl))->GetFunction(isolate->GetEnteredOrMicrotaskContext()).ToLocalChecked())
332332

333333

334334
static void v8js_named_property_enumerator(const v8::PropertyCallbackInfo<v8::Array> &info) /* {{{ */
335335
{
336336
// note: 'special' properties like 'constructor' are not enumerated.
337337
v8::Isolate *isolate = info.GetIsolate();
338-
v8::Local<v8::Context> v8_context = isolate->GetEnteredContext();
338+
v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext();
339339

340340
v8::Local<v8::Object> self = info.Holder();
341341
v8::Local<v8::Array> result = v8::Array::New(isolate, 0);
@@ -435,7 +435,7 @@ static void v8js_named_property_enumerator(const v8::PropertyCallbackInfo<v8::Ar
435435
static void v8js_invoke_callback(const v8::FunctionCallbackInfo<v8::Value>& info) /* {{{ */
436436
{
437437
v8::Isolate *isolate = info.GetIsolate();
438-
v8::Local<v8::Context> v8_context = isolate->GetEnteredContext();
438+
v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext();
439439

440440
v8::Local<v8::Object> self = info.Holder();
441441
v8::Local<v8::Function> cb = v8::Local<v8::Function>::Cast(info.Data());
@@ -480,7 +480,7 @@ static void v8js_invoke_callback(const v8::FunctionCallbackInfo<v8::Value>& info
480480
static void v8js_fake_call_impl(const v8::FunctionCallbackInfo<v8::Value>& info) /* {{{ */
481481
{
482482
v8::Isolate *isolate = info.GetIsolate();
483-
v8::Local<v8::Context> v8_context = isolate->GetEnteredContext();
483+
v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext();
484484

485485
v8::Local<v8::Object> self = info.Holder();
486486
v8::Local<v8::Value> return_value = V8JS_NULL;
@@ -623,7 +623,7 @@ v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::Name> property_n
623623
v8::Local<v8::String> property = v8::Local<v8::String>::Cast(property_name);
624624

625625
v8::Isolate *isolate = info.GetIsolate();
626-
v8::Local<v8::Context> v8_context = isolate->GetEnteredContext();
626+
v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext();
627627
v8js_ctx *ctx = (v8js_ctx *) isolate->GetData(0);
628628
v8::String::Utf8Value cstr(isolate, property);
629629
const char *name = ToCString(cstr);
@@ -848,7 +848,7 @@ static void v8js_named_property_query(v8::Local<v8::Name> property, const v8::Pr
848848
}
849849

850850
v8::Isolate *isolate = info.GetIsolate();
851-
v8::MaybeLocal<v8::Integer> value = r->ToInteger(isolate->GetEnteredContext());
851+
v8::MaybeLocal<v8::Integer> value = r->ToInteger(isolate->GetEnteredOrMicrotaskContext());
852852
if (!value.IsEmpty()) {
853853
info.GetReturnValue().Set(value.ToLocalChecked());
854854
}

v8js_v8.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ int v8js_get_properties_hash(v8::Local<v8::Value> jsValue, HashTable *retval, in
304304
}
305305

306306
/* Skip any prototype properties */
307-
if (!jsObj->HasOwnProperty(isolate->GetEnteredContext(), jsKey).FromMaybe(false)
307+
if (!jsObj->HasOwnProperty(isolate->GetEnteredOrMicrotaskContext(), jsKey).FromMaybe(false)
308308
&& !jsObj->HasRealNamedProperty(v8_context, jsKey).FromMaybe(false)
309309
&& !jsObj->HasRealNamedCallbackProperty(v8_context, jsKey).FromMaybe(false)) {
310310
continue;

v8js_v8object_class.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ static int v8js_v8object_call_method(zend_string *method, zend_object *object, I
344344
std::function< v8::MaybeLocal<v8::Value>(v8::Isolate *) > v8_call = [obj, method, argc, argv, object, &return_value](v8::Isolate *isolate) {
345345
int i = 0;
346346

347-
v8::Local<v8::Context> v8_context = isolate->GetEnteredContext();
347+
v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext();
348348
v8::Local<v8::String> method_name = V8JS_SYML(ZSTR_VAL(method), static_cast<int>(ZSTR_LEN(method)));
349349
v8::Local<v8::Object> v8obj = v8::Local<v8::Value>::New(isolate, obj->v8obj)->ToObject(v8_context).ToLocalChecked();
350350
v8::Local<v8::Object> thisObj;
@@ -573,7 +573,7 @@ static void v8js_v8generator_next(v8js_v8generator *g) /* {{{ */
573573
* some memory on bailout. */
574574
{
575575
std::function< v8::MaybeLocal<v8::Value>(v8::Isolate *) > v8_call = [g](v8::Isolate *isolate) {
576-
v8::Local<v8::Context> v8_context = isolate->GetEnteredContext();
576+
v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext();
577577
v8::Local<v8::String> method_name = V8JS_SYM("next");
578578
v8::Local<v8::Object> v8obj = v8::Local<v8::Value>::New(isolate, g->v8obj.v8obj)->ToObject(v8_context).ToLocalChecked();
579579
v8::Local<v8::Function> cb = v8::Local<v8::Function>::Cast(v8obj->Get(v8_context, method_name).ToLocalChecked());;

0 commit comments

Comments
 (0)