It seems other interpreters do not return an exception in this case.
#include <njs_object.h>
#include <njs_function.h>
#include <math.h>
-#include <errno.h>
static njs_ret_t
for (i = 2; i < nargs; i++) {
num = hypot(num, args[i].data.u.number);
- if (num == HUGE_VAL) {
- /* HUGE_VAL is equal to INFINITY on IEEE-754 systems. */
-
- if (nxt_slow_path(errno == ERANGE)) {
- vm->exception = &njs_exception_range_error;
- return NXT_ERROR;
- }
-
+ if (num == INFINITY) {
break;
}
}