Ejemplo n.º 1
0
EncodedJSValue JSC_HOST_CALL jsTextEventPrototypeFunctionInitTextEvent(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSTextEvent::s_info))
        return throwVMTypeError(exec);
    JSTextEvent* castedThis = static_cast<JSTextEvent*>(asObject(thisValue));
    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTextEvent::s_info);
    TextEvent* imp = static_cast<TextEvent*>(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());
    DOMWindow* viewArg(toDOMWindow(exec->argument(3)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    const String& dataArg(ustringToString(exec->argument(4).toString(exec)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    imp->initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg);
    return JSValue::encode(jsUndefined());
}
Ejemplo n.º 2
0
 static v8::Handle<v8::Value> initTextEventCallback(const v8::Arguments& args) {
   INC_STATS("DOM.TextEvent.initTextEvent");
   TextEvent* imp = V8TextEvent::toNative(args.Holder());
   V8Parameter<> typeArg = args[0];
   bool canBubbleArg = args[1]->BooleanValue();
   bool cancelableArg = args[2]->BooleanValue();
   DOMWindow* viewArg = V8DOMWindow::HasInstance(args[3]) ? V8DOMWindow::toNative(v8::Handle<v8::Object>::Cast(args[3])) : 0;
   V8Parameter<> dataArg = args[4];
   imp->initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg);
   return v8::Handle<v8::Value>();
 }
Ejemplo n.º 3
0
static v8::Handle<v8::Value> initTextEventCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.TextEvent.initTextEvent");
    TextEvent* imp = V8TextEvent::toNative(args.Holder());
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, typeArg, MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined));
    EXCEPTION_BLOCK(bool, canBubbleArg, MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined)->BooleanValue());
    EXCEPTION_BLOCK(bool, cancelableArg, MAYBE_MISSING_PARAMETER(args, 2, MissingIsUndefined)->BooleanValue());
    EXCEPTION_BLOCK(DOMWindow*, viewArg, V8DOMWindow::HasInstance(MAYBE_MISSING_PARAMETER(args, 3, MissingIsUndefined)) ? V8DOMWindow::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 3, MissingIsUndefined))) : 0);
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, dataArg, MAYBE_MISSING_PARAMETER(args, 4, MissingIsUndefined));
    imp->initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg);
    return v8::Handle<v8::Value>();
}
Ejemplo n.º 4
0
static v8::Handle<v8::Value> initTextEventCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.TextEvent.initTextEvent");
    TextEvent* imp = V8TextEvent::toNative(args.Holder());
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, typeArg, args[0]);
    EXCEPTION_BLOCK(bool, canBubbleArg, args[1]->BooleanValue());
    EXCEPTION_BLOCK(bool, cancelableArg, args[2]->BooleanValue());
    EXCEPTION_BLOCK(DOMWindow*, viewArg, V8DOMWindow::HasInstance(args[3]) ? V8DOMWindow::toNative(v8::Handle<v8::Object>::Cast(args[3])) : 0);
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, dataArg, args[4]);
    imp->initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg);
    return v8::Handle<v8::Value>();
}
Ejemplo n.º 5
0
JSValue* jsTextEventPrototypeFunctionInitTextEvent(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSTextEvent::s_info))
        return throwError(exec, TypeError);
    JSTextEvent* castedThisObj = static_cast<JSTextEvent*>(thisValue);
    TextEvent* imp = static_cast<TextEvent*>(castedThisObj->impl());
    const UString& typeArg = args[0]->toString(exec);
    bool canBubbleArg = args[1]->toBoolean(exec);
    bool cancelableArg = args[2]->toBoolean(exec);
    DOMWindow* viewArg = toDOMWindow(args[3]);
    const UString& dataArg = args[4]->toString(exec);

    imp->initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg);
    return jsUndefined();
}
JSValue* JSTextEventPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
{
    if (!thisObj->inherits(&JSTextEvent::info))
      return throwError(exec, TypeError);

    TextEvent* imp = static_cast<TextEvent*>(static_cast<JSTextEvent*>(thisObj)->impl());

    switch (id) {
    case JSTextEvent::InitTextEventFuncNum: {
        String typeArg = args[0]->toString(exec);
        bool canBubbleArg = args[1]->toBoolean(exec);
        bool cancelableArg = args[2]->toBoolean(exec);
        DOMWindow* viewArg = toDOMWindow(args[3]);
        String dataArg = args[4]->toString(exec);

        imp->initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg);
        return jsUndefined();
    }
    }
    return 0;
}