Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.dynjs.runtime.builtins.types.number.prototype;
 
 
 public class ValueOf extends AbstractNativeFunction {
    public ValueOf(GlobalObject globalObject) {
        super(globalObject);
    }
    @Override
    public Object call(ExecutionContext contextObject selfObject... args) {
        // 15.7.4.4
        if (self instanceof DynNumber) {
            return ((DynNumberself).getPrimitiveValue();
        }
        if ( self instanceof Number ) {
            return self;
        }
        throw new ThrowExceptioncontextcontext.createTypeError"Number.valueOf() only allowed on Numbers" ));
    }
New to GrepCode? Check out our FAQ X