@Override
    public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
                             Scriptable thisObj, Object[] args)
    {
        if (!f.hasTag(CLASS_NAME)) {
            return super.execIdCall(f, cx, scope, thisObj, args);
        }
        int id = f.methodId();
        switch (id) {
        case ConstructorId_isView:
            return (isArg(args, 0) && (args[0] instanceof NativeArrayBufferView));

        case Id_constructor:
            double length = isArg(args, 0) ? ScriptRuntime.toNumber(args[0]) : 0;
            return new NativeArrayBuffer(length);

        case Id_slice:
            NativeArrayBuffer self = realThis(thisObj, f);
            double start = isArg(args, 0) ? ScriptRuntime.toNumber(args[0]) : 0;
            double end = isArg(args, 1) ? ScriptRuntime.toNumber(args[1]) : self.buffer.length;
            return self.slice(start, end);
        }
        throw new IllegalArgumentException(String.valueOf(id));
    }
@ Override public Object execIdCall ( IdFunctionObject f , Context cx , Scriptable scope , Scriptable thisObj , Object [ ] args ) { if ( ! f . hasTag ( CLASS_NAME ) ) { return super . execIdCall ( f , cx , scope , thisObj , args ) ; } int id = f . methodId ( ) ; switch ( id ) { case ConstructorId_isView : return ( isArg ( args , 0 ) && ( args [ 0 ] instanceof NativeArrayBufferView ) ) ; case Id_constructor : double length = isArg ( args , 0 ) ? ScriptRuntime . toNumber ( args [ 0 ] ) : 0 ; return new NativeArrayBuffer ( length ) ; case Id_slice : NativeArrayBuffer self = realThis ( thisObj , f ) ; double start = isArg ( args , 0 ) ? ScriptRuntime . toNumber ( args [ 0 ] ) : 0 ; double end = isArg ( args , 1 ) ? ScriptRuntime . toNumber ( args [ 1 ] ) : self . buffer . length ; return self . slice ( start , end ) ; } throw new IllegalArgumentException ( String . valueOf ( id ) ) ; }
Function-calling dispatcher