nashorn/test/script/basic/es6/for-let.js
changeset 27817 56f6161c3e55
parent 26377 028dad61662f
child 27977 42799be30dcd
--- a/nashorn/test/script/basic/es6/for-let.js	Thu Nov 27 17:14:01 2014 +0400
+++ b/nashorn/test/script/basic/es6/for-let.js	Thu Nov 27 16:42:53 2014 +0100
@@ -39,3 +39,40 @@
 } catch (e) {
     print(e);
 }
+
+let a = [];
+
+for (let i = 0; i < 10; i++) {
+    a.push(function() { print(i); });
+}
+
+a.forEach(function(f) { f(); });
+
+a = [];
+
+for (let i = 0; i < 10; i++) {
+    if (i == 5) {
+        i = "foo";
+    }
+    a.push(function() { print(i); });
+}
+
+a.forEach(function(f) { f(); });
+
+try {
+    print(i);
+} catch (e) {
+    print(e);
+}
+
+a = [];
+
+for (let i = 0; i < 20; i++) {
+    if (i % 2 == 1) {
+        i += 2;
+        continue;
+    }
+    a.push(function() { print(i); });
+}
+
+a.forEach(function(f) { f(); });