case JS_ITERATOR_HELPER_KIND_DROP:
case JS_ITERATOR_HELPER_KIND_TAKE:
{
- JSValue v;
double dlimit;
- v = JS_ToNumber(ctx, argv[0]);
- if (JS_IsException(v))
- goto fail;
- // Check for Infinity.
- if (JS_ToFloat64(ctx, &dlimit, v)) {
- JS_FreeValue(ctx, v);
+ if (JS_ToFloat64(ctx, &dlimit, argv[0]))
goto fail;
- }
- if (isnan(dlimit)) {
- JS_FreeValue(ctx, v);
+ if (isnan(dlimit))
goto range_error;
- }
- if (!isfinite(dlimit)) {
- JS_FreeValue(ctx, v);
- if (dlimit < 0)
+ if (dlimit < INT64_MIN) {
+ count = INT64_MIN;
+ } else if (dlimit > MAX_SAFE_INTEGER) {
+ if (isfinite(dlimit))
goto range_error;
else
count = MAX_SAFE_INTEGER;
} else {
- v = JS_ToIntegerFree(ctx, v);
- if (JS_IsException(v))
- goto fail;
- if (JS_ToInt64Free(ctx, &count, v))
- goto fail;
+ count = (int64_t)dlimit;
}
if (count < 0)
goto range_error;
test262/test/annexB/language/expressions/assignmenttargettype/callexpression-in-prefix-update.js:27: SyntaxError: invalid increment/decrement operand
test262/test/annexB/language/expressions/assignmenttargettype/callexpression.js:33: SyntaxError: invalid assignment left-hand side
test262/test/annexB/language/expressions/assignmenttargettype/cover-callexpression-and-asyncarrowhead.js:20: SyntaxError: invalid assignment left-hand side
-test262/test/built-ins/Iterator/prototype/drop/argument-effect-order.js:27: Test262Error: Expected a RangeError to be thrown but no exception was thrown at all
-test262/test/built-ins/Iterator/prototype/drop/argument-effect-order.js:27: strict mode: Test262Error: Expected a RangeError to be thrown but no exception was thrown at all
-test262/test/built-ins/Iterator/prototype/drop/argument-validation-failure-closes-underlying.js:18: Test262Error: Expected a RangeError but got a Test262Error
-test262/test/built-ins/Iterator/prototype/drop/argument-validation-failure-closes-underlying.js:18: strict mode: Test262Error: Expected a RangeError but got a Test262Error
-test262/test/built-ins/Iterator/prototype/drop/limit-rangeerror.js:29: Test262Error: Expected a RangeError to be thrown but no exception was thrown at all
-test262/test/built-ins/Iterator/prototype/drop/limit-rangeerror.js:29: strict mode: Test262Error: Expected a RangeError to be thrown but no exception was thrown at all
-test262/test/built-ins/Iterator/prototype/take/argument-effect-order.js:44: Test262Error: Expected a RangeError to be thrown but no exception was thrown at all
-test262/test/built-ins/Iterator/prototype/take/argument-effect-order.js:44: strict mode: Test262Error: Expected a RangeError to be thrown but no exception was thrown at all
-test262/test/built-ins/Iterator/prototype/take/argument-validation-failure-closes-underlying.js:18: Test262Error: Expected a RangeError but got a Test262Error
-test262/test/built-ins/Iterator/prototype/take/argument-validation-failure-closes-underlying.js:18: strict mode: Test262Error: Expected a RangeError but got a Test262Error
-test262/test/built-ins/Iterator/prototype/take/limit-rangeerror.js:29: Test262Error: Expected a RangeError to be thrown but no exception was thrown at all
-test262/test/built-ins/Iterator/prototype/take/limit-rangeerror.js:29: strict mode: Test262Error: Expected a RangeError to be thrown but no exception was thrown at all
test262/test/built-ins/Promise/try/avoids-wrap-for-subclass.js:10: Test262Error: Expected SameValue(«[object Promise]», «[object Promise]») to be true
test262/test/built-ins/Promise/try/avoids-wrap-for-subclass.js:10: strict mode: Test262Error: Expected SameValue(«[object Promise]», «[object Promise]») to be true
test262/test/built-ins/Promise/try/avoids-wrap.js:10: Test262Error: Expected SameValue(«[object Promise]», «[object Promise]») to be true