Searched refs:toNumber (Results 1 - 25 of 31) sorted by relevance

12

/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/
H A DNativeMath.java96 return Math.abs(JSType.toNumber(x));
148 return Math.acos(JSType.toNumber(x));
174 return Math.asin(JSType.toNumber(x));
200 return Math.atan(JSType.toNumber(x));
227 return Math.atan2(JSType.toNumber(y), JSType.toNumber(x));
254 return Math.ceil(JSType.toNumber(x));
306 return Math.cos(JSType.toNumber(x));
332 return Math.exp(JSType.toNumber(x));
345 return Math.floor(JSType.toNumber(
[all...]
H A DNativeUint8ClampedArray.java184 return set(index, JSType.toNumber(value), strict);
204 return rint(JSType.toNumber(rint));
H A DNativeDate.java193 num = timeClip(JSType.toNumber(args[0]));
570 final double num = timeClip(JSType.toNumber(time));
799 final double yearNum = JSType.toNumber(year);
1218 final double darg = JSType.toNumber(args[i]);
1242 // Need to call toNumber on all args for side-effects - even if an argument
1243 // fails to convert to number, subsequent toNumber calls needed for possible
1247 final double darg = JSType.toNumber(args[i - fieldId]);
H A DNativeJSON.java182 modSpace = JSType.toNumber(JSType.toPrimitive(modSpace, Number.class));
258 value = JSType.toNumber(value);
H A DNativeFloat32Array.java155 return set(index, JSType.toNumber(value), strict);
H A DNativeFloat64Array.java155 return set(index, JSType.toNumber(value), strict);
H A DNativeDataView.java880 getBuffer(self, littleEndian).putFloat((int)JSType.toUint32(byteOffset), (float)JSType.toNumber(value));
936 getBuffer(self, littleEndian).putDouble((int)JSType.toUint32(byteOffset), JSType.toNumber(value));
H A DNativeNumber.java146 final double num = (args.length > 0) ? JSType.toNumber(args[0]) : 0.0;
H A DArrayBufferView.java281 final double dlen = JSType.toNumber(arg0);
/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/
H A DJSObject.java195 default double toNumber() { method in interface:JSObject
196 return JSType.toNumber(JSType.toPrimitive(this, Number.class));
H A DAbstractJSObject.java206 public double toNumber() { method in class:AbstractJSObject
/openjdk10/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/extensions/
H A DExpressionContext.java61 public double toNumber(Node n); method in interface:ExpressionContext
/openjdk10/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/lib/
H A DExsltMath.java78 double d = toNumber(n);
113 double d = toNumber(n);
153 double d = toNumber(n);
190 double d = toNumber(n);
H A DExsltBase.java71 protected static double toNumber(Node n) method in class:ExsltBase
/openjdk10/nashorn/test/src/jdk/nashorn/internal/runtime/test/
H A DJSTypeTest.java80 * Test of toNumber method, of class Runtime.
84 assertTrue(Double.isNaN(JSType.toNumber(ScriptRuntime.UNDEFINED)));
85 assertEquals(JSType.toNumber((Object)null), 0.0, 0.0);
86 assertEquals(JSType.toNumber(Boolean.TRUE), 1.0, 0.0);
87 assertEquals(JSType.toNumber(Boolean.FALSE), 0.0, 0.0);
88 assertEquals(JSType.toNumber(3.14), 3.14, 0.0);
/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/
H A DJSONListAdapter.java153 public double toNumber() { method in class:JSONListAdapter
154 return obj.toNumber();
H A DJSType.java102 public static final Call TO_NUMBER = staticCall(JSTYPE_LOOKUP, JSType.class, "toNumber", double.class, Object.class);
758 public static double toNumber(final Object obj) { method in class:JSType
769 * Converts an object for a comparison with a number. Almost identical to {@link #toNumber(Object)} but
778 // handle them here to avoid throwing an error in toNumber conversion.
779 return obj == null || obj instanceof Symbol || obj instanceof NativeSymbol ? Double.NaN : toNumber(obj);
818 public static double toNumber(final Boolean b) { method in class:JSType
830 public static double toNumber(final ScriptObject obj) { method in class:JSType
831 return toNumber(toPrimitive(obj, Number.class));
852 * Object to number conversion that delegates to either {@link #toNumber(Object)} or to
860 return UnwarrantedOptimismException.isValid(programPoint) ? toNumberOptimistic(obj, programPoint) : toNumber(ob
908 public static double toNumber(final String str) { method in class:JSType
[all...]
H A DScriptRuntime.java697 return JSType.toNumber(xPrim) + JSType.toNumber(yPrim);
997 // Specification says comparing a number to string should be done as "equals(num, JSType.toNumber(str))". We
1000 return ((Number)num).doubleValue() == JSType.toNumber(str.toString());
1004 return equals(JSType.toNumber((Boolean)bool), any);
1144 JSType.toNumber(px) < JSType.toNumber(py);
1164 JSType.toNumber(px) > JSType.toNumber(py);
1180 JSType.toNumber(p
[all...]
H A DDefaultPropertyAccess.java53 return JSType.toNumber(get(key));
H A DGlobalFunctions.java330 return Double.isNaN(JSType.toNumber(number));
342 final double value = JSType.toNumber(number);
/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/
H A DJavaArgumentConverters.java51 private static final MethodHandle TO_NUMBER = findOwnMH("toNumber", Number.class, Object.class);
149 return JSType.toNumber((String) obj);
151 return JSType.toNumber(obj.toString());
165 private static Number toNumber(final Object obj0) { method in class:JavaArgumentConverters
173 return JSType.toNumber((String) obj);
175 return JSType.toNumber(obj.toString());
/openjdk10/nashorn/test/script/basic/
H A DJDK-8072426.js57 toNumber: function() {
58 // toNumber no longer invoked
64 // Test JSObjectLinker toInt32/toLong/toNumber
83 // Test fallback from toNumber to toString for numeric conversion when toNumber doesn't exist
92 // Test fallback from toNumber to toString for numeric conversion when toNumber isn't a callable
101 // Test fallback from toNumber to toString for numeric conversion when toNumber returns a non-primitive
110 // Test TypeError from toNumber t
[all...]
/openjdk10/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/arrays/
H A DLengthNotWritableFilter.java96 return JSType.toNumber(get(index));
H A DObjectArrayData.java219 return JSType.toNumber(array[index]);
H A DSparseArrayData.java251 return JSType.toNumber(sparseMap.get(indexToKey(index)));

Completed in 156 milliseconds

12