本文整理汇总了C++中ErrorEvent::initErrorEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ ErrorEvent::initErrorEvent方法的具体用法?C++ ErrorEvent::initErrorEvent怎么用?C++ ErrorEvent::initErrorEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorEvent
的用法示例。
在下文中一共展示了ErrorEvent::initErrorEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsErrorEventPrototypeFunctionInitErrorEvent
EncodedJSValue JSC_HOST_CALL jsErrorEventPrototypeFunctionInitErrorEvent(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSErrorEvent::s_info))
return throwVMTypeError(exec);
JSErrorEvent* castedThis = static_cast<JSErrorEvent*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSErrorEvent::s_info);
ErrorEvent* imp = static_cast<ErrorEvent*>(castedThis->impl());
const String& typeArg(ustringToString(exec->argument(0).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
bool canBubbleArg(exec->argument(1).toBoolean(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
bool cancelableArg(exec->argument(2).toBoolean(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
const String& messageArg(ustringToString(exec->argument(3).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
const String& filenameArg(ustringToString(exec->argument(4).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
unsigned linenoArg(exec->argument(5).toUInt32(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
imp->initErrorEvent(typeArg, canBubbleArg, cancelableArg, messageArg, filenameArg, linenoArg);
return JSValue::encode(jsUndefined());
}
示例2: jsErrorEventPrototypeFunctionInitErrorEvent
JSValue JSC_HOST_CALL jsErrorEventPrototypeFunctionInitErrorEvent(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.inherits(&JSErrorEvent::s_info))
return throwError(exec, TypeError);
JSErrorEvent* castedThisObj = static_cast<JSErrorEvent*>(asObject(thisValue));
ErrorEvent* imp = static_cast<ErrorEvent*>(castedThisObj->impl());
const UString& typeArg = args.at(0).toString(exec);
bool canBubbleArg = args.at(1).toBoolean(exec);
bool cancelableArg = args.at(2).toBoolean(exec);
const UString& messageArg = args.at(3).toString(exec);
const UString& filenameArg = args.at(4).toString(exec);
unsigned linenoArg = args.at(5).toInt32(exec);
imp->initErrorEvent(typeArg, canBubbleArg, cancelableArg, messageArg, filenameArg, linenoArg);
return jsUndefined();
}