@@ -1426,6 +1426,36 @@ Local<Value> Script::Run() {
1426
1426
return Utils::ToLocal (result);
1427
1427
}
1428
1428
1429
+ #ifdef QT_BUILD_SCRIPT_LIB
1430
+ Local<Value> Script::Run (Handle<Object> receiver) {
1431
+ i::Isolate* isolate = i::Isolate::Current ();
1432
+ ON_BAILOUT (isolate, " v8::Script::Run()" , return Local<Value>());
1433
+ LOG_API (isolate, " Script::Run" );
1434
+ ENTER_V8 (isolate);
1435
+ i::Object* raw_result = NULL ;
1436
+ {
1437
+ i::HandleScope scope (isolate);
1438
+ i::Handle<i::Object> obj = Utils::OpenHandle (this );
1439
+ i::Handle<i::JSFunction> fun;
1440
+ if (obj->IsSharedFunctionInfo ()) {
1441
+ i::Handle<i::SharedFunctionInfo>
1442
+ function_info (i::SharedFunctionInfo::cast (*obj));
1443
+ fun = isolate->factory ()->NewFunctionFromSharedFunctionInfo (
1444
+ function_info, isolate->global_context ());
1445
+ } else {
1446
+ fun = i::Handle<i::JSFunction>(i::JSFunction::cast (*obj));
1447
+ }
1448
+ EXCEPTION_PREAMBLE (isolate);
1449
+ i::Handle<i::Object> recv = Utils::OpenHandle (*receiver);
1450
+ i::Handle<i::Object> result =
1451
+ i::Execution::Call (fun, recv, 0 , NULL , &has_pending_exception);
1452
+ EXCEPTION_BAILOUT_CHECK (isolate, Local<Value>());
1453
+ raw_result = *result;
1454
+ }
1455
+ i::Handle<i::Object> result (raw_result);
1456
+ return Utils::ToLocal (result);
1457
+ }
1458
+ #endif
1429
1459
1430
1460
static i::Handle<i::SharedFunctionInfo> OpenScript (Script* script) {
1431
1461
i::Handle<i::Object> obj = Utils::OpenHandle (script);
0 commit comments