Ejemplo n.º 1
0
JSValue jsProgressEventLengthComputable(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSProgressEvent* castedThis = static_cast<JSProgressEvent*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    ProgressEvent* imp = static_cast<ProgressEvent*>(castedThis->impl());
    JSValue result = jsBoolean(imp->lengthComputable());
    return result;
}
Ejemplo n.º 2
0
JSValue* JSProgressEvent::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case LengthComputableAttrNum: {
        ProgressEvent* imp = static_cast<ProgressEvent*>(impl());
        return jsBoolean(imp->lengthComputable());
    }
    case LoadedAttrNum: {
        ProgressEvent* imp = static_cast<ProgressEvent*>(impl());
        return jsNumber(exec, imp->loaded());
    }
    case TotalAttrNum: {
        ProgressEvent* imp = static_cast<ProgressEvent*>(impl());
        return jsNumber(exec, imp->total());
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}