@@ -562,8 +562,8 @@ CallbackHandlers::GetImplementedInterfaces(JEnv& env, const Local<Object>& imple
562
562
auto context = isolate->GetCurrentContext ();
563
563
auto propNames = implementationObject->GetOwnPropertyNames (context).ToLocalChecked ();
564
564
for (int i = 0 ; i < propNames->Length (); i++) {
565
- auto name = propNames->Get (i ).As <String>();
566
- auto prop = implementationObject->Get (name);
565
+ auto name = propNames->Get (context, i). ToLocalChecked ( ).As <String>();
566
+ auto prop = implementationObject->Get (context, name). ToLocalChecked ( );
567
567
568
568
bool arrFound = !prop.IsEmpty () && prop->IsArray ();
569
569
@@ -575,12 +575,13 @@ CallbackHandlers::GetImplementedInterfaces(JEnv& env, const Local<Object>& imple
575
575
576
576
auto context = isolate->GetCurrentContext ();
577
577
int length = interfacesArr->Get (
578
- v8::String::NewFromUtf8 (isolate, " length" ).ToLocalChecked ())->ToObject (context).ToLocalChecked ()->Uint32Value (
578
+ context,
579
+ v8::String::NewFromUtf8 (isolate, " length" ).ToLocalChecked ()).ToLocalChecked ()->ToObject (context).ToLocalChecked ()->Uint32Value (
579
580
context).ToChecked ();
580
581
581
582
if (length > 0 ) {
582
583
for (int i = 0 ; i < length; i++) {
583
- auto element = interfacesArr->Get (i );
584
+ auto element = interfacesArr->Get (context, i). ToLocalChecked ( );
584
585
585
586
if (element->IsFunction ()) {
586
587
auto node = MetadataNode::GetTypeMetadataName (isolate, element);
@@ -621,8 +622,8 @@ CallbackHandlers::GetMethodOverrides(JEnv& env, const Local<Object>& implementat
621
622
auto context = isolate->GetCurrentContext ();
622
623
auto propNames = implementationObject->GetOwnPropertyNames (context).ToLocalChecked ();
623
624
for (int i = 0 ; i < propNames->Length (); i++) {
624
- auto name = propNames->Get (i ).As <String>();
625
- auto method = implementationObject->Get (name);
625
+ auto name = propNames->Get (context, i). ToLocalChecked ( ).As <String>();
626
+ auto method = implementationObject->Get (context, name). ToLocalChecked ( );
626
627
627
628
bool methodFound = !method.IsEmpty () && method->IsFunction ();
628
629
@@ -823,7 +824,8 @@ Local<Value> CallbackHandlers::CallJSMethod(Isolate* isolate, JNIEnv* _env,
823
824
JEnv env (_env);
824
825
Local<Value> result;
825
826
826
- auto method = jsObject->Get (ArgConverter::ConvertToV8String (isolate, methodName));
827
+ auto context = isolate->GetCurrentContext ();
828
+ auto method = jsObject->Get (context, ArgConverter::ConvertToV8String (isolate, methodName)).ToLocalChecked ();
827
829
828
830
if (method.IsEmpty () || method->IsUndefined ()) {
829
831
stringstream ss;
@@ -842,7 +844,7 @@ Local<Value> CallbackHandlers::CallJSMethod(Isolate* isolate, JNIEnv* _env,
842
844
843
845
std::vector<Local<Value>> arguments (argc);
844
846
for (int i = 0 ; i < argc; i++) {
845
- arguments[i] = jsArgs->Get (i );
847
+ arguments[i] = jsArgs->Get (context, i). ToLocalChecked ( );
846
848
}
847
849
848
850
auto context = isolate->GetCurrentContext ();
@@ -1032,7 +1034,7 @@ void CallbackHandlers::WorkerGlobalOnMessageCallback(Isolate* isolate, jstring m
1032
1034
1033
1035
TryCatch tc (isolate);
1034
1036
1035
- auto callback = globalObject->Get (ArgConverter::ConvertToV8String (isolate, " onmessage" ));
1037
+ auto callback = globalObject->Get (context, ArgConverter::ConvertToV8String (isolate, " onmessage" )). ToLocalChecked ( );
1036
1038
auto isEmpty = callback.IsEmpty ();
1037
1039
auto isFunction = callback->IsFunction ();
1038
1040
@@ -1142,7 +1144,8 @@ CallbackHandlers::WorkerObjectOnMessageCallback(Isolate* isolate, jint workerId,
1142
1144
1143
1145
auto worker = Local<Object>::New (isolate, *workerPersistent);
1144
1146
1145
- auto callback = worker->Get (ArgConverter::ConvertToV8String (isolate, " onmessage" ));
1147
+ auto context = isolate->GetCurrentContext ();
1148
+ auto callback = worker->Get (context, ArgConverter::ConvertToV8String (isolate, " onmessage" )).ToLocalChecked ();
1146
1149
auto isEmpty = callback.IsEmpty ();
1147
1150
auto isFunction = callback->IsFunction ();
1148
1151
@@ -1247,18 +1250,20 @@ void CallbackHandlers::WorkerGlobalCloseCallback(const v8::FunctionCallbackInfo<
1247
1250
auto globalObject = context->Global ();
1248
1251
1249
1252
auto isTerminating = globalObject->Get (
1250
- ArgConverter::ConvertToV8String (isolate, " isTerminating" ));
1253
+ context,
1254
+ ArgConverter::ConvertToV8String (isolate, " isTerminating" )).ToLocalChecked ();
1251
1255
1252
1256
if (!isTerminating.IsEmpty () && isTerminating->BooleanValue (isolate)) {
1253
1257
DEBUG_WRITE (" WORKER: WorkerThreadCloseCallback - Worker is currently terminating..." );
1254
1258
return ;
1255
1259
}
1256
1260
1257
- globalObject->Set (ArgConverter::ConvertToV8String (isolate, " isTerminating" ),
1261
+ globalObject->Set (context,
1262
+ ArgConverter::ConvertToV8String (isolate, " isTerminating" ),
1258
1263
Boolean::New (isolate, true ));
1259
1264
1260
1265
// execute onclose handler if one is implemented
1261
- auto callback = globalObject->Get (ArgConverter::ConvertToV8String (isolate, " onclose" ));
1266
+ auto callback = globalObject->Get (context, ArgConverter::ConvertToV8String (isolate, " onclose" )). ToLocalChecked ( );
1262
1267
auto isEmpty = callback.IsEmpty ();
1263
1268
auto isFunction = callback->IsFunction ();
1264
1269
@@ -1305,7 +1310,7 @@ void CallbackHandlers::CallWorkerScopeOnErrorHandle(Isolate* isolate, TryCatch&
1305
1310
auto globalObject = context->Global ();
1306
1311
1307
1312
// execute onerror handle if one is implemented
1308
- auto callback = globalObject->Get (ArgConverter::ConvertToV8String (isolate, " onerror" ));
1313
+ auto callback = globalObject->Get (context, ArgConverter::ConvertToV8String (isolate, " onerror" )). ToLocalChecked ( );
1309
1314
auto isEmpty = callback.IsEmpty ();
1310
1315
auto isFunction = callback->IsFunction ();
1311
1316
@@ -1392,19 +1397,24 @@ CallbackHandlers::CallWorkerObjectOnErrorHandle(Isolate* isolate, jint workerId,
1392
1397
1393
1398
auto worker = Local<Object>::New (isolate, *workerPersistent);
1394
1399
1395
- auto callback = worker->Get (ArgConverter::ConvertToV8String (isolate, " onerror" ));
1400
+ auto context = isolate->GetCurrentContext ();
1401
+ auto callback = worker->Get (context, ArgConverter::ConvertToV8String (isolate, " onerror" )).ToLocalChecked ();
1396
1402
auto isEmpty = callback.IsEmpty ();
1397
1403
auto isFunction = callback->IsFunction ();
1398
1404
1399
1405
if (!isEmpty && isFunction) {
1400
1406
auto errEvent = Object::New (isolate);
1401
- errEvent->Set (ArgConverter::ConvertToV8String (isolate, " message" ),
1407
+ errEvent->Set (context,
1408
+ ArgConverter::ConvertToV8String (isolate, " message" ),
1402
1409
ArgConverter::jstringToV8String (isolate, message));
1403
- errEvent->Set (ArgConverter::ConvertToV8String (isolate, " stackTrace" ),
1410
+ errEvent->Set (context,
1411
+ ArgConverter::ConvertToV8String (isolate, " stackTrace" ),
1404
1412
ArgConverter::jstringToV8String (isolate, stackTrace));
1405
- errEvent->Set (ArgConverter::ConvertToV8String (isolate, " filename" ),
1413
+ errEvent->Set (context,
1414
+ ArgConverter::ConvertToV8String (isolate, " filename" ),
1406
1415
ArgConverter::jstringToV8String (isolate, filename));
1407
- errEvent->Set (ArgConverter::ConvertToV8String (isolate, " lineno" ),
1416
+ errEvent->Set (context,
1417
+ ArgConverter::ConvertToV8String (isolate, " lineno" ),
1408
1418
Number::New (isolate, lineno));
1409
1419
1410
1420
Local<Value> args1[] = {errEvent};
0 commit comments