/** * Returns the value of the argument at the given index. * * @param index The index of the argument value to return. * @return The value of argument at the given index. */ public ValueMirror getArgumentValue(final int index) { V8Array parameters = new V8Array(v8Object.getRuntime()); parameters.push(index); V8Object result = null; try { result = v8Object.executeObjectFunction(ARGUMENT_VALUE, parameters); if (!isValue(result)) { throw new IllegalStateException("Argument value is not a ValueMirror"); } return new ValueMirror(result); } finally { parameters.close(); if (result != null) { result.close(); } } }
protected static ValueMirror createMirror(final V8Object mirror) { if (isNull(mirror)) { return new NullMirror(mirror); } else if (isUndefined(mirror)) { return new UndefinedMirror(mirror); } else if (isFunction(mirror)) { return new FunctionMirror(mirror); } else if (isArray(mirror)) { return new ArrayMirror(mirror); } else if (isObject(mirror)) { return new ObjectMirror(mirror); } else if (isString(mirror)) { return new StringMirror(mirror); } else if (isNumber(mirror)) { return new NumberMirror(mirror); } else if (isBoolean(mirror)) { return new BooleanMirror(mirror); } return new ValueMirror(mirror); }
/** * Returns the value of the argument at the given index. * * @param index The index of the argument value to return. * @return The value of argument at the given index. */ public ValueMirror getArgumentValue(final int index) { V8Array parameters = new V8Array(v8Object.getRuntime()); parameters.push(index); V8Object result = null; try { result = v8Object.executeObjectFunction(ARGUMENT_VALUE, parameters); if (!isValue(result)) { throw new IllegalStateException("Argument value is not a ValueMirror"); } return new ValueMirror(result); } finally { parameters.close(); if (result != null) { result.close(); } } }
protected static ValueMirror createMirror(final V8Object mirror) { if (isNull(mirror)) { return new NullMirror(mirror); } else if (isUndefined(mirror)) { return new UndefinedMirror(mirror); } else if (isFunction(mirror)) { return new FunctionMirror(mirror); } else if (isArray(mirror)) { return new ArrayMirror(mirror); } else if (isObject(mirror)) { return new ObjectMirror(mirror); } else if (isString(mirror)) { return new StringMirror(mirror); } else if (isNumber(mirror)) { return new NumberMirror(mirror); } else if (isBoolean(mirror)) { return new BooleanMirror(mirror); } return new ValueMirror(mirror); }
/** * Returns the value of the argument at the given index. * * @param index The index of the argument value to return. * @return The value of argument at the given index. */ public ValueMirror getArgumentValue(final int index) { V8Array parameters = new V8Array(v8Object.getRuntime()); parameters.push(index); V8Object result = null; try { result = v8Object.executeObjectFunction(ARGUMENT_VALUE, parameters); if (!isValue(result)) { throw new IllegalStateException("Argument value is not a ValueMirror"); } return new ValueMirror(result); } finally { parameters.release(); if (result != null) { result.release(); } } }
/** * Returns the value of the argument at the given index. * * @param index The index of the argument value to return. * @return The value of argument at the given index. */ public ValueMirror getArgumentValue(final int index) { V8Array parameters = new V8Array(v8Object.getRuntime()); parameters.push(index); V8Object result = null; try { result = v8Object.executeObjectFunction(ARGUMENT_VALUE, parameters); if (!isValue(result)) { throw new IllegalStateException("Argument value is not a ValueMirror"); } return new ValueMirror(result); } finally { parameters.release(); if (result != null) { result.release(); } } }
protected static ValueMirror createMirror(final V8Object mirror) { if (isNull(mirror)) { return new NullMirror(mirror); } else if (isUndefined(mirror)) { return new UndefinedMirror(mirror); } else if (isFunction(mirror)) { return new FunctionMirror(mirror); } else if (isArray(mirror)) { return new ArrayMirror(mirror); } else if (isObject(mirror)) { return new ObjectMirror(mirror); } else if (isString(mirror)) { return new StringMirror(mirror); } else if (isNumber(mirror)) { return new NumberMirror(mirror); } else if (isBoolean(mirror)) { return new BooleanMirror(mirror); } return new ValueMirror(mirror); }
protected static ValueMirror createMirror(final V8Object mirror) { if (isNull(mirror)) { return new NullMirror(mirror); } else if (isUndefined(mirror)) { return new UndefinedMirror(mirror); } else if (isFunction(mirror)) { return new FunctionMirror(mirror); } else if (isArray(mirror)) { return new ArrayMirror(mirror); } else if (isObject(mirror)) { return new ObjectMirror(mirror); } else if (isString(mirror)) { return new StringMirror(mirror); } else if (isNumber(mirror)) { return new NumberMirror(mirror); } else if (isBoolean(mirror)) { return new BooleanMirror(mirror); } return new ValueMirror(mirror); }