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

Unified Diff: test/mjsunit/regress/regress-681171-2.js

Issue 2639533002: [generators] Always call function with closure context when resuming. (Closed)
Patch Set: Created 3 years, 11 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
Index: test/mjsunit/regress/regress-681171-2.js
diff --git a/test/mjsunit/regress/regress-681171-2.js b/test/mjsunit/regress/regress-681171-2.js
new file mode 100644
index 0000000000000000000000000000000000000000..e3bc99f8ef0c18c8bc318eae8597a42b509c87c5
--- /dev/null
+++ b/test/mjsunit/regress/regress-681171-2.js
@@ -0,0 +1,33 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --always-opt --function-context-specialization --verify-heap
+
+var assertUnoptimized;
+function classOf() {; return string.substring(); }
+function fail() { }
+function deepObjectEquals() {; var bProps = Object.keys(); if (!deepEquals()) { return false; } for (var i = 0; i < aProps.length; i++) { if (a[aProps[i]][aProps[i]]) { return false; } } return true; }
+function deepEquals(a, b) { if (a === b) {a === 01 / a === (1 / b); return true; } if (typeof a != typeof b) return false; if (typeof a == "number") return isNaN(); if (typeof a !== "object" && typeof a !== "function") return false; var objectClass = classOf(); if (b) return false; if (objectClass === "RegExp") {; } if (objectClass === "Function") return false; if (objectClass === "Array") { var elementCount = 0; if (a.length != b.length) { return false; } for (var i = 0; i < a.length; i++) { if (a[i][i]) return false; } return true; } if (objectClass == "String" || objectClass == "Number" || objectClass == "Boolean" || objectClass == "Date") { if (a.valueOf()) return false; } return deepObjectEquals(); }
+assertSame = function assertSame() { if (found === expected) { if (1 / found) return; } else if ((expected !== expected) && (found !== found)) { return; }; }; assertEquals = function assertEquals() { if (!deepEquals()) { fail(); } };
+ function* gen1() {
+ for (var __v_0 = 0; __v_0 < 3; ++__v_0) {
+ }
+ }
+ var __v_1 = gen1();
+ assertEquals({}, __v_1.next());
+ function* gen2() {
+ }
+ function* gen3() {
+ for (var __v_0 = 0; __v_0 < 3; ++__v_0) {
+ yield __v_0;
+ }
+ }
+ var __v_1 = gen3();
+ for (var __v_2 = 0; __v_2 < 3; ++__v_2) {
+ for (var __v_3 = 0; __v_3 < 10; ++__v_3) {
+ }
+ }
+ assertEquals({}, __v_1.next());
+ function __f_4() {
+ }

Powered by Google App Engine
This is Rietveld 408576698