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

Unified Diff: test/mjsunit/harmony/generators-iteration.js

Issue 14158006: Capture receiver in generator object (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Rebase on master, fix for ARM Created 7 years, 8 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/x64/full-codegen-x64.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/generators-iteration.js
diff --git a/test/mjsunit/harmony/generators-iteration.js b/test/mjsunit/harmony/generators-iteration.js
index be795ea2be3760d72881c2d4a43ad541526da729..5d41fc2493d4b6a78a0931ae1d9783a826c00816 100644
--- a/test/mjsunit/harmony/generators-iteration.js
+++ b/test/mjsunit/harmony/generators-iteration.js
@@ -211,32 +211,27 @@ TestGenerator(function* g16() { yield "baz"; gc(); yield "qux"; },
["baz", "qux", undefined]);
// Receivers.
-function TestReceivers() {
- TestGenerator(
- function g17() {
- function* g() { yield this.x; yield this.y; }
- var o = { start: g, x: 1, y: 2 };
- return o.start();
- },
- [1, 2, undefined],
- "foo",
- [1, 2, undefined]);
+TestGenerator(
+ function g17() {
+ function* g() { yield this.x; yield this.y; }
+ var o = { start: g, x: 1, y: 2 };
+ return o.start();
+ },
+ [1, 2, undefined],
+ "foo",
+ [1, 2, undefined]);
- TestGenerator(
- function g18() {
- function* g() { yield this.x; yield this.y; }
- var iter = new g;
- iter.x = 1;
- iter.y = 2;
- return iter;
- },
- [1, 2, undefined],
- "foo",
- [1, 2, undefined]);
-}
-// TODO(wingo): Enable this test. Currently accessing "this" doesn't work as
-// prior to generators, nothing needed to heap-allocate the receiver.
-// TestReceivers();
+TestGenerator(
+ function g18() {
+ function* g() { yield this.x; yield this.y; }
+ var iter = new g;
+ iter.x = 1;
+ iter.y = 2;
+ return iter;
+ },
+ [1, 2, undefined],
+ "foo",
+ [1, 2, undefined]);
function TestRecursion() {
function TestNextRecursion() {
« no previous file with comments | « src/x64/full-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698