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

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

Issue 14348003: Add support for yield expressions (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Fix formatting; add asserts; don't skip write barrier 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/runtime.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 09a4cc50d6472be689745f21bd6a63bd4fe07d70..b64d583b7b86a82a4e44fb224cf182e2c526a2a9 100644
--- a/test/mjsunit/harmony/generators-iteration.js
+++ b/test/mjsunit/harmony/generators-iteration.js
@@ -239,6 +239,32 @@ function TestReceivers() {
// TestReceivers();
TestGenerator(
+ function* g20() { yield (1 + (yield 2) + 3); },
+ [2, NaN, undefined],
+ "foo",
+ [2, "1foo3", undefined]);
+
+TestGenerator(
+ function* g21() { return (1 + (yield 2) + 3); },
+ [2, NaN],
+ "foo",
+ [2, "1foo3"]);
+
+TestGenerator(
+ function* g22() { yield (1 + (yield 2) + 3); yield (4 + (yield 5) + 6); },
+ [2, NaN, 5, NaN, undefined],
+ "foo",
+ [2, "1foo3", 5, "4foo6", undefined]);
+
+TestGenerator(
+ function* g23() {
+ return (yield (1 + (yield 2) + 3)) + (yield (4 + (yield 5) + 6));
+ },
+ [2, NaN, 5, NaN, NaN],
+ "foo",
+ [2, "1foo3", 5, "4foo6", "foofoo"]);
+
+TestGenerator(
function* g() {
var x = 1;
yield x;
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698