MCPcopy Create free account
hub / github.com/mozilla/rhino / min

Method min

rhino/src/main/java/org/mozilla/javascript/NativeMath.java:509–518  ·  view source on GitHub ↗
(
            Context cx, JSFunction f, Object nt, VarScope s, Object thisObj, Object[] args)

Source from the content-addressed store, hash-verified

507 }
508
509 private static Object min(
510 Context cx, JSFunction f, Object nt, VarScope s, Object thisObj, Object[] args) {
511 double x = Double.POSITIVE_INFINITY;
512 for (int i = 0; i != args.length; ++i) {
513 double d = ScriptRuntime.toNumber(args[i]);
514 // if (x < d) x = d; does not work due to -0.0 >= +0.0
515 x = Math.min(x, d);
516 }
517 return ScriptRuntime.wrapNumber(x);
518 }
519
520 // See Ecma 15.8.2.13
521 private static Object pow(

Callers 15

stringifyMethod · 0.80
toIndexMethod · 0.80
toLengthMethod · 0.80
replacementMethod · 0.80
js_fillMethod · 0.80
js_copyWithinMethod · 0.80
js_toSplicedMethod · 0.80
initializeArgsMethod · 0.80
js_SymbolSplitSlowMethod · 0.80
js_SymbolSplitFastMethod · 0.80
makeIndentMethod · 0.80
js_sliceMethod · 0.80

Calls 2

toNumberMethod · 0.95
wrapNumberMethod · 0.95

Tested by 1

readMethod · 0.64