Ejemplo n.º 1
0
JSValue jsClientRectListLength(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSClientRectList* castedThis = static_cast<JSClientRectList*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    ClientRectList* imp = static_cast<ClientRectList*>(castedThis->impl());
    JSValue result = jsNumber(exec, imp->length());
    return result;
}
Ejemplo n.º 2
0
static v8::Handle<v8::Value> itemCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.ClientRectList.item");
    ClientRectList* imp = V8ClientRectList::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    EXCEPTION_BLOCK(int, index, toUInt32(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)));
    if (UNLIKELY(index < 0)) {
        ec = INDEX_SIZE_ERR;
        goto fail;
    }
    return toV8(imp->item(index));
    }
    fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}
Ejemplo n.º 3
0
EncodedJSValue JSC_HOST_CALL jsClientRectListPrototypeFunctionItem(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSClientRectList::s_info))
        return throwVMTypeError(exec);
    JSClientRectList* castedThis = static_cast<JSClientRectList*>(asObject(thisValue));
    ClientRectList* imp = static_cast<ClientRectList*>(castedThis->impl());
    int index = exec->argument(0).toInt32(exec);
    if (index < 0) {
        setDOMException(exec, INDEX_SIZE_ERR);
        return JSValue::encode(jsUndefined());
    }


    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->item(index)));
    return JSValue::encode(result);
}
Ejemplo n.º 4
0
static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.ClientRectList.length._get");
    ClientRectList* imp = V8ClientRectList::toNative(info.Holder());
    return v8::Integer::NewFromUnsigned(imp->length());
}