本文整理汇总了C++中jsc::ExecState::clearException方法的典型用法代码示例。如果您正苦于以下问题:C++ ExecState::clearException方法的具体用法?C++ ExecState::clearException怎么用?C++ ExecState::clearException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jsc::ExecState
的用法示例。
在下文中一共展示了ExecState::clearException方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: didAddUserAgentShadowRoot
void HTMLPlugInImageElement::didAddUserAgentShadowRoot(ShadowRoot* root)
{
HTMLPlugInElement::didAddUserAgentShadowRoot(root);
if (displayState() >= PreparingPluginReplacement)
return;
Page* page = document().page();
if (!page)
return;
// Reset any author styles that may apply as we only want explicit
// styles defined in the injected user agents stylesheets to specify
// the look-and-feel of the snapshotted plug-in overlay.
root->setResetStyleInheritance(true);
String mimeType = loadedMimeType();
DOMWrapperWorld& isolatedWorld = plugInImageElementIsolatedWorld();
document().ensurePlugInsInjectedScript(isolatedWorld);
ScriptController& scriptController = document().frame()->script();
JSDOMGlobalObject* globalObject = JSC::jsCast<JSDOMGlobalObject*>(scriptController.globalObject(isolatedWorld));
JSC::ExecState* exec = globalObject->globalExec();
JSC::JSLockHolder lock(exec);
JSC::MarkedArgumentBuffer argList;
argList.append(toJS(exec, globalObject, root));
argList.append(jsString(exec, titleText(page, mimeType)));
argList.append(jsString(exec, subtitleText(page, mimeType)));
// This parameter determines whether or not the snapshot overlay should always be visible over the plugin snapshot.
// If no snapshot was found then we want the overlay to be visible.
argList.append(JSC::jsBoolean(!m_snapshotImage));
// It is expected the JS file provides a createOverlay(shadowRoot, title, subtitle) function.
JSC::JSObject* overlay = globalObject->get(exec, JSC::Identifier::fromString(exec, "createOverlay")).toObject(exec);
if (!overlay) {
ASSERT(exec->hadException());
exec->clearException();
return;
}
JSC::CallData callData;
JSC::CallType callType = overlay->methodTable()->getCallData(overlay, callData);
if (callType == JSC::CallType::None)
return;
JSC::call(exec, overlay, callType, callData, globalObject, argList);
exec->clearException();
}
示例2: asFilenames
void DragData::asFilenames(Vector<String>& result) const
{
bool success;
JSC::JSValue data = m_platformDragData->getData(ClipboardApolloHelper::FILE_LIST_TYPE, success);
JSC::ExecState *exec = m_platformDragData->execState();
if (success && data.isObject()) {
JSC::JSObject* filenameArray = data.toObject(exec);
uint32_t length = filenameArray->get(exec, JSC::Identifier(exec, "length")).toUInt32(exec);
for (uint32_t i=0; i<length; i++) {
JSC::JSValue fileValue = filenameArray->get(exec, i);
if (fileValue.isObject()) {
JSC::JSObject* file = fileValue.toObject(exec);
JSC::JSValue pathValue = file->get(exec, JSC::Identifier(exec, "nativePath"));
if (pathValue.isString()) {
String path = ustringToString(pathValue.toString(exec));
result.append(path);
}
}
}
}
if (exec->hadException())
exec->clearException();
}
示例3: storeException
void ReadableJSStream::storeException(JSC::ExecState& state)
{
JSValue exception = state.exception()->value();
state.clearException();
storeError(state, exception);
}