Exemplo n.º 1
0
static v8::Handle<v8::Value> anotherFunctionCallback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    TestCustomNamedGetter* imp = V8TestCustomNamedGetter::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    imp->anotherFunction(str);
    return v8Undefined();
}
static v8::Handle<v8::Value> anotherFunctionMethod(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    TestCustomNamedGetter* imp = V8TestCustomNamedGetter::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, str, args[0]);
    imp->anotherFunction(str);
    return v8Undefined();
}
Exemplo n.º 3
0
static v8::Handle<v8::Value> anotherFunctionCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.TestCustomNamedGetter.anotherFunction");
    if (args.Length() < 1)
        return V8Proxy::throwNotEnoughArgumentsError();
    TestCustomNamedGetter* imp = V8TestCustomNamedGetter::toNative(args.Holder());
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    imp->anotherFunction(str);
    return v8::Handle<v8::Value>();
}
Exemplo n.º 4
0
EncodedJSValue JSC_HOST_CALL jsTestCustomNamedGetterPrototypeFunctionAnotherFunction(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSTestCustomNamedGetter::s_info))
        return throwVMTypeError(exec);
    JSTestCustomNamedGetter* castedThis = jsCast<JSTestCustomNamedGetter*>(asObject(thisValue));
    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestCustomNamedGetter::s_info);
    TestCustomNamedGetter* impl = static_cast<TestCustomNamedGetter*>(castedThis->impl());
    if (exec->argumentCount() < 1)
        return throwVMError(exec, createNotEnoughArgumentsError(exec));
    const String& str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    impl->anotherFunction(str);
    return JSValue::encode(jsUndefined());
}