Exemple #1
0
v8::Handle<v8::Value> V8DataView::getInt8Callback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());

    DataView* imp = V8DataView::toNative(args.Holder());
    ExceptionCode ec = 0;
    V8TRYCATCH(unsigned, byteOffset, toUInt32(args[0]));
    int8_t result = imp->getInt8(byteOffset, ec);
    if (UNLIKELY(ec))
        return setDOMException(ec, args.GetIsolate());
    return v8Integer(result, args.GetIsolate());
}
Exemple #2
0
v8::Handle<v8::Value> V8DataView::getInt8Callback(const v8::Arguments& args)
{
    INC_STATS("DOM.DataView.getInt8");
    if (args.Length() < 1)
        return throwError("Not enough arguments", V8Proxy::SyntaxError);

    DataView* imp = V8DataView::toNative(args.Holder());
    ExceptionCode ec = 0;
    EXCEPTION_BLOCK(unsigned, byteOffset, toUInt32(args[0]));
    int8_t result = imp->getInt8(byteOffset, ec);
    if (UNLIKELY(ec)) {
        V8Proxy::setDOMException(ec);
        return v8::Handle<v8::Value>();
    }
    return v8::Integer::New(result);
}