summaryrefslogtreecommitdiff
path: root/deps/v8/src/generator.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/generator.js')
-rw-r--r--deps/v8/src/generator.js19
1 files changed, 4 insertions, 15 deletions
diff --git a/deps/v8/src/generator.js b/deps/v8/src/generator.js
index 5e6109156..cc31a4458 100644
--- a/deps/v8/src/generator.js
+++ b/deps/v8/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);