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

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

Issue 328093002: Add @@iterator for generator objects (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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/generator.js ('k') | tools/generate-runtime-tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/generators-runtime.js
diff --git a/test/mjsunit/harmony/generators-runtime.js b/test/mjsunit/harmony/generators-runtime.js
index 196adff81b0ae586427115496e5c79b01822f513..9fb70754928e2ebe990694694a352cc4a9c9558d 100644
--- a/test/mjsunit/harmony/generators-runtime.js
+++ b/test/mjsunit/harmony/generators-runtime.js
@@ -29,9 +29,8 @@
// Test aspects of the generator runtime.
-// FIXME(wingo): Replace this reference with a more official link.
// See:
-// http://wiki.ecmascript.org/lib/exe/fetch.php?cache=cache&media=harmony:es6_generator_object_model_3-29-13.png
+// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorfunction-objects
function f() { }
function* g() { yield 1; }
@@ -101,6 +100,16 @@ function TestGeneratorObjectPrototype() {
found_property_names.sort();
assertArrayEquals(expected_property_names, found_property_names);
+
+ iterator_desc = Object.getOwnPropertyDescriptor(GeneratorObjectPrototype,
+ Symbol.iterator);
+ assertTrue(iterator_desc !== undefined);
+ assertFalse(iterator_desc.writable);
+ assertFalse(iterator_desc.enumerable);
+ assertFalse(iterator_desc.configurable);
+
+ // The generator object's "iterator" function is just the identity.
+ assertSame(iterator_desc.value.call(42), 42);
}
TestGeneratorObjectPrototype();
« no previous file with comments | « src/generator.js ('k') | tools/generate-runtime-tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698