Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1320)

Unified Diff: test/mjsunit/harmony/empty-for.js

Issue 377833003: Fix for-loop with const/let and empty condition/iteration statements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/empty-for.js
diff --git a/test/mjsunit/regress/regress-354433.js b/test/mjsunit/harmony/empty-for.js
similarity index 74%
copy from test/mjsunit/regress/regress-354433.js
copy to test/mjsunit/harmony/empty-for.js
index 80ea28623021bafc8ab291cc2bdd1078424610fb..02211260ff5d1bd2cd50feb16c6b09b1984f69ea 100644
--- a/test/mjsunit/regress/regress-354433.js
+++ b/test/mjsunit/harmony/empty-for.js
@@ -25,30 +25,48 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax
-
-var __v_0 = {};
-var __v_5 = {};
-function __f_2() {
- this.__defineGetter__('str', function() { return __f_2(this); });
- this.str = "1";
- this.toString = function() {
- return this.str;
- };
-};
-
-__v_5 = new __f_2();
-__v_0 = new __f_2();
-
-function __f_5(fun,a,b) {
- __v_5.str = a;
- __v_0.str = b;
- fun(__v_5, __v_0);
+// Flags: --harmony-scoping
+
+"use strict";
+
+function for_const() {
+ for (const x = 1;;) {
+ if (x == 1) break;
+ }
+ for (const x = 1; x < 2;) {
+ if (x == 1) break;
+ }
+ for (const x = 1;; 0) {
+ if (x == 1) break;
+ }
}
-function __f_8(a,b) { return a%b };
+for_const();
+
+function for_let() {
+ for (let x;;) {
+ if (!x) break;
+ }
+ for (let x; x < 2;) {
+ if (!x) break;
+ }
+ for (let x = 1;; x++) {
+ if (x == 2) break;
+ }
+}
+
+for_let();
+
+function for_var() {
+ for (var x;;) {
+ if (!x) break;
+ }
+ for (var x; x < 2;) {
+ if (!x) break;
+ }
+ for (var x = 1;; x++) {
+ if (x == 2) break;
+ }
+}
-__f_5(__f_8, 1 << 30, 1);
-__f_5(__f_8, 1, 1 << 30);
-%OptimizeFunctionOnNextCall(__f_8);
-__f_5(__f_8, 1, 1 << 30);
+for_var();
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698