]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/throw-from-ftl-in-loop.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / throw-from-ftl-in-loop.js
diff --git a/tests/stress/throw-from-ftl-in-loop.js b/tests/stress/throw-from-ftl-in-loop.js
new file mode 100644 (file)
index 0000000..b87cc8e
--- /dev/null
@@ -0,0 +1,13 @@
+var didThrow = false;
+try {
+    (function() {
+        for (var i = 0; i < 1000000; ++i) { }
+        throw 42;
+    })();
+} catch (e) {
+    if (e != 42)
+        throw "Error: bad result: " + e;
+    didThrow = true;
+}
+if (!didThrow)
+    throw "Error: should have thrown but didn't.";