@@ -3213,6 +3213,49 @@ int v8::Object::GetIndexedPropertiesExternalArrayDataLength() {
3213
3213
}
3214
3214
}
3215
3215
3216
+ #ifdef QT_BUILD_SCRIPT_LIB
3217
+ bool v8::Object::IsCallable () {
3218
+ i::Isolate* isolate = i::Isolate::Current ();
3219
+ ON_BAILOUT (isolate, " v8::Object::IsCallable()" , return false );
3220
+ ENTER_V8 (isolate);
3221
+ i::Handle<i::JSObject> obj = Utils::OpenHandle (this );
3222
+ if (obj->IsJSFunction ())
3223
+ return true ;
3224
+ HandleScope scope;
3225
+ return i::Execution::GetFunctionDelegate (obj)->IsJSFunction ();
3226
+ }
3227
+
3228
+ Local<v8::Value> v8::Object::Call (v8::Handle<v8::Object> recv, int argc,
3229
+ v8::Handle<v8::Value> argv[]) {
3230
+ i::Isolate* isolate = i::Isolate::Current ();
3231
+ ON_BAILOUT (isolate, " v8::Object::Call()" , return Local<v8::Value>());
3232
+ LOG_API (isolate, " Object::Call" );
3233
+ ENTER_V8 (isolate);
3234
+ i::Object* raw_result = NULL ;
3235
+ {
3236
+ HandleScope scope;
3237
+ i::Handle<i::JSObject> obj = Utils::OpenHandle (this );
3238
+ i::Handle<i::Object> recv_obj = Utils::OpenHandle (*recv);
3239
+ STATIC_ASSERT (sizeof (v8::Handle<v8::Value>) == sizeof (i::Object**));
3240
+ i::Object*** args = reinterpret_cast <i::Object***>(argv);
3241
+ i::Handle<i::JSFunction> fun;
3242
+ if (obj->IsJSFunction ()) {
3243
+ fun = i::Handle<i::JSFunction>::cast (obj);
3244
+ } else {
3245
+ fun = i::Handle<i::JSFunction>::cast (i::Execution::GetFunctionDelegate (obj));
3246
+ recv_obj = obj;
3247
+ }
3248
+ EXCEPTION_PREAMBLE (isolate);
3249
+ i::Handle<i::Object> returned =
3250
+ i::Execution::Call (fun, recv_obj, argc, args, &has_pending_exception);
3251
+ EXCEPTION_BAILOUT_CHECK (isolate, Local<Object>());
3252
+ raw_result = *returned;
3253
+ }
3254
+ i::Handle<i::Object> result (raw_result);
3255
+ return Utils::ToLocal (result);
3256
+ }
3257
+ #endif
3258
+
3216
3259
3217
3260
Local<v8::Object> Function::NewInstance () const {
3218
3261
return NewInstance (0 , NULL );
0 commit comments