From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- js/src/jit-test/tests/closures/closure-pluseq.js | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 js/src/jit-test/tests/closures/closure-pluseq.js (limited to 'js/src/jit-test/tests/closures/closure-pluseq.js') diff --git a/js/src/jit-test/tests/closures/closure-pluseq.js b/js/src/jit-test/tests/closures/closure-pluseq.js new file mode 100644 index 0000000000..ccf5c82709 --- /dev/null +++ b/js/src/jit-test/tests/closures/closure-pluseq.js @@ -0,0 +1,31 @@ +actual = ''; +expected = '3,6,9,12,15,18,'; + +function slice(a, b) +{ + //return { x: a + ':' + b }; + return b; +} + +function f() +{ + var length = 20; + var index = 0; + + function get3() { + //appendToActual("get3 " + index); + if (length - index < 3) + return null; + return slice(index, index += 3); + } + + var bytes = null; + while (bytes = get3()) { + appendToActual(bytes); + } +} + +f(); + + +assertEq(actual, expected) -- cgit v1.2.3