本文整理汇总了C++中JSDOMGlobalObject::methodTable方法的典型用法代码示例。如果您正苦于以下问题:C++ JSDOMGlobalObject::methodTable方法的具体用法?C++ JSDOMGlobalObject::methodTable怎么用?C++ JSDOMGlobalObject::methodTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSDOMGlobalObject
的用法示例。
在下文中一共展示了JSDOMGlobalObject::methodTable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleEvent
void JSErrorHandler::handleEvent(ScriptExecutionContext* scriptExecutionContext, Event* event)
{
if (!event->hasInterface(eventNames().interfaceForErrorEvent))
return JSEventListener::handleEvent(scriptExecutionContext, event);
ASSERT(scriptExecutionContext);
if (!scriptExecutionContext)
return;
ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
JSLock lock(SilenceAssertionsOnly);
JSObject* jsFunction = this->jsFunction(scriptExecutionContext);
if (!jsFunction)
return;
JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(scriptExecutionContext, isolatedWorld());
if (!globalObject)
return;
ExecState* exec = globalObject->globalExec();
CallData callData;
CallType callType = jsFunction->methodTable()->getCallData(jsFunction, callData);
if (callType != CallTypeNone) {
RefPtr<JSErrorHandler> protectedctor(this);
Event* savedEvent = globalObject->currentEvent();
globalObject->setCurrentEvent(event);
MarkedArgumentBuffer args;
args.append(jsString(exec, errorEvent->message()));
args.append(jsString(exec, errorEvent->filename()));
args.append(jsNumber(errorEvent->lineno()));
JSGlobalData& globalData = globalObject->globalData();
DynamicGlobalObjectScope globalObjectScope(globalData, globalData.dynamicGlobalObject ? globalData.dynamicGlobalObject : globalObject);
JSValue thisValue = globalObject->methodTable()->toThisObject(globalObject, exec);
globalData.timeoutChecker.start();
JSValue returnValue = scriptExecutionContext->isDocument()
? JSMainThreadExecState::call(exec, jsFunction, callType, callData, thisValue, args)
: JSC::call(exec, jsFunction, callType, callData, thisValue, args);
globalData.timeoutChecker.stop();
globalObject->setCurrentEvent(savedEvent);
if (exec->hadException())
reportCurrentException(exec);
else {
if (returnValue.isTrue())
event->preventDefault();
}
}
}