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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --always-opt --function-context-specialization --verify-heap
6
7 var assertUnoptimized;
8 function classOf() {; return string.substring(); }
9 function fail() { }
10 function deepObjectEquals() {; var bProps = Object.keys(); if (!deepEquals()) { return false; } for (var i = 0; i < aProps.length; i++) { if (a[aProps[i]][aProp s[i]]) { return false; } } return true; }
11 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 isNa N(); if (typeof a !== "object" && typeof a !== "function") return false; var obj ectClass = classOf(); if (b) return false; if (objectClass === "RegExp") {; } if (objectClass === "Function") return false; if (objectClass === "Array") { var e lementCount = 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(); }
12 assertSame = function assertSame() { if (found === expected) { if (1 / found) re turn; } else if ((expected !== expected) && (found !== found)) { return; }; }; a ssertEquals = function assertEquals() { if (!deepEquals()) { fail(); } };
13 function* gen1() {
14 for (var __v_0 = 0; __v_0 < 3; ++__v_0) {
15 }
16 }
17 var __v_1 = gen1();
18 assertEquals({}, __v_1.next());
19 function* gen2() {
20 }
21 function* gen3() {
22 for (var __v_0 = 0; __v_0 < 3; ++__v_0) {
23 yield __v_0;
24 }
25 }
26 var __v_1 = gen3();
27 for (var __v_2 = 0; __v_2 < 3; ++__v_2) {
28 for (var __v_3 = 0; __v_3 < 10; ++__v_3) {
29 }
30 }
31 assertEquals({}, __v_1.next());
32 function __f_4() {
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698