@@ -38,7 +38,7 @@ static void v8js_weak_object_callback(const v8::WeakCallbackInfo<zend_object> &d
38
38
static void v8js_call_php_func (zend_object *object, zend_function *method_ptr, const v8::FunctionCallbackInfo<v8::Value>& info) /* {{{ */
39
39
{
40
40
v8::Isolate *isolate = info.GetIsolate ();
41
- v8::Local<v8::Context> v8_context = isolate->GetEnteredContext ();
41
+ v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext ();
42
42
v8::Local<v8::Value> return_value = V8JS_NULL;
43
43
zend_fcall_info fci;
44
44
zend_fcall_info_cache fcc;
@@ -231,8 +231,8 @@ static void v8js_construct_callback(const v8::FunctionCallbackInfo<v8::Value>& i
231
231
v8::Local<v8::Array> cons_data = v8::Local<v8::Array>::Cast (info.Data ());
232
232
v8::Local<v8::Value> cons_tmpl, cons_ce;
233
233
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))
236
236
{
237
237
return ;
238
238
}
@@ -328,14 +328,14 @@ static void v8js_weak_closure_callback(const v8::WeakCallbackInfo<v8js_function_
328
328
!strncasecmp(ZSTR_VAL(key), mname, ZSTR_LEN(key)))
329
329
330
330
#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())
332
332
333
333
334
334
static void v8js_named_property_enumerator(const v8::PropertyCallbackInfo<v8::Array> &info) /* {{{ */
335
335
{
336
336
// note: 'special' properties like 'constructor' are not enumerated.
337
337
v8::Isolate *isolate = info.GetIsolate ();
338
- v8::Local<v8::Context> v8_context = isolate->GetEnteredContext ();
338
+ v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext ();
339
339
340
340
v8::Local<v8::Object> self = info.Holder ();
341
341
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
435
435
static void v8js_invoke_callback (const v8::FunctionCallbackInfo<v8::Value>& info) /* {{{ */
436
436
{
437
437
v8::Isolate *isolate = info.GetIsolate ();
438
- v8::Local<v8::Context> v8_context = isolate->GetEnteredContext ();
438
+ v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext ();
439
439
440
440
v8::Local<v8::Object> self = info.Holder ();
441
441
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
480
480
static void v8js_fake_call_impl (const v8::FunctionCallbackInfo<v8::Value>& info) /* {{{ */
481
481
{
482
482
v8::Isolate *isolate = info.GetIsolate ();
483
- v8::Local<v8::Context> v8_context = isolate->GetEnteredContext ();
483
+ v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext ();
484
484
485
485
v8::Local<v8::Object> self = info.Holder ();
486
486
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
623
623
v8::Local<v8::String> property = v8::Local<v8::String>::Cast (property_name);
624
624
625
625
v8::Isolate *isolate = info.GetIsolate ();
626
- v8::Local<v8::Context> v8_context = isolate->GetEnteredContext ();
626
+ v8::Local<v8::Context> v8_context = isolate->GetEnteredOrMicrotaskContext ();
627
627
v8js_ctx *ctx = (v8js_ctx *) isolate->GetData (0 );
628
628
v8::String::Utf8Value cstr (isolate, property);
629
629
const char *name = ToCString (cstr);
@@ -848,7 +848,7 @@ static void v8js_named_property_query(v8::Local<v8::Name> property, const v8::Pr
848
848
}
849
849
850
850
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 ());
852
852
if (!value.IsEmpty ()) {
853
853
info.GetReturnValue ().Set (value.ToLocalChecked ());
854
854
}
0 commit comments