summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Tests
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-05 00:22:42 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-05 00:22:42 +0200
commit9ebd066ac84d6a4b132299c4a927e2c4049a2f42 (patch)
treef88ed91b0c838b5cf5d95f994f3c1081418c8022 /Libraries/LibJS/Tests
parente3b92caa6d9f00a25095d294601131e106b94c93 (diff)
downloadserenity-9ebd066ac84d6a4b132299c4a927e2c4049a2f42.zip
LibJS: Add support for "continue" inside "for" statements :^)
Diffstat (limited to 'Libraries/LibJS/Tests')
-rw-r--r--Libraries/LibJS/Tests/continue-basic.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/Libraries/LibJS/Tests/continue-basic.js b/Libraries/LibJS/Tests/continue-basic.js
new file mode 100644
index 0000000000..eda0648f08
--- /dev/null
+++ b/Libraries/LibJS/Tests/continue-basic.js
@@ -0,0 +1,14 @@
+function assert(x) { if (!x) throw 1; }
+
+try {
+ var j = 0;
+ for (var i = 0; i < 9; ++i) {
+ if (i == 3)
+ continue;
+ ++j;
+ }
+ assert(j == 8);
+ console.log("PASS");
+} catch {
+}
+