Index: src/generator.js |
diff --git a/src/generator.js b/src/generator.js |
index 5e61091565567bf9d516a45d0efd72add6aa33af..cc31a44588412380a32e626f70ae16abbd90aa29 100644 |
--- a/src/generator.js |
+++ b/src/generator.js |
@@ -34,26 +34,16 @@ |
// ---------------------------------------------------------------------------- |
-// TODO(wingo): Give link to specification. For now, the following diagram is |
-// the spec: |
-// http://wiki.ecmascript.org/lib/exe/fetch.php?cache=cache&media=harmony:es6_generator_object_model_3-29-13.png |
+// Generator functions and objects are specified by ES6, sections 15.19.3 and |
+// 15.19.4. |
-function GeneratorObjectNext() { |
+function GeneratorObjectNext(value) { |
if (!IS_GENERATOR(this)) { |
throw MakeTypeError('incompatible_method_receiver', |
['[Generator].prototype.next', this]); |
} |
- return %_GeneratorSend(this, void 0); |
-} |
- |
-function GeneratorObjectSend(value) { |
- if (!IS_GENERATOR(this)) { |
- throw MakeTypeError('incompatible_method_receiver', |
- ['[Generator].prototype.send', this]); |
- } |
- |
- return %_GeneratorSend(this, value); |
+ return %_GeneratorNext(this, value); |
} |
function GeneratorObjectThrow(exn) { |
@@ -71,7 +61,6 @@ function SetUpGenerators() { |
InstallFunctions(GeneratorObjectPrototype, |
DONT_ENUM | DONT_DELETE | READ_ONLY, |
["next", GeneratorObjectNext, |
- "send", GeneratorObjectSend, |
"throw", GeneratorObjectThrow]); |
%SetProperty(GeneratorObjectPrototype, "constructor", |
GeneratorFunctionPrototype, DONT_ENUM | DONT_DELETE | READ_ONLY); |