Beispiel #1
0
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());
}
Beispiel #2
0
JSValue jsErrorEventLineno(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSErrorEvent* castedThis = static_cast<JSErrorEvent*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    ErrorEvent* imp = static_cast<ErrorEvent*>(castedThis->impl());
    JSValue result = jsNumber(imp->lineno());
    return result;
}
Beispiel #3
0
JSValue jsErrorEventFilename(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSErrorEvent* castedThis = static_cast<JSErrorEvent*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    ErrorEvent* imp = static_cast<ErrorEvent*>(castedThis->impl());
    JSValue result = jsString(exec, imp->filename());
    return result;
}
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();
}
Beispiel #5
0
JSValue jsErrorEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSErrorEvent* domObject = static_cast<JSErrorEvent*>(asObject(slotBase));
    return JSErrorEvent::getConstructor(exec, domObject->globalObject());
}