Пример #1
0
JSValue jsMediaListLength(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSMediaList* castedThis = static_cast<JSMediaList*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    MediaList* imp = static_cast<MediaList*>(castedThis->impl());
    JSValue result = jsNumber(imp->length());
    return result;
}
Пример #2
0
JSValue* JSMediaList::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case MediaTextAttrNum: {
        MediaList* imp = static_cast<MediaList*>(impl());
        return jsStringOrNull(exec, imp->mediaText());
    }
    case LengthAttrNum: {
        MediaList* imp = static_cast<MediaList*>(impl());
        return jsNumber(exec, imp->length());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
Пример #3
0
static v8::Handle<v8::Value> lengthAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.MediaList.length._get");
    MediaList* imp = V8MediaList::toNative(info.Holder());
    return v8::Integer::NewFromUnsigned(imp->length());
}