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

Unified Diff: src/generator.js

Issue 14066016: Generators can resume (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Use Abort() instead of int3() 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/full-codegen.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/generator.js
diff --git a/src/generator.js b/src/generator.js
index 481d4d37f88f4d2ce3541b5ae04ff13495a4c998..5e61091565567bf9d516a45d0efd72add6aa33af 100644
--- a/src/generator.js
+++ b/src/generator.js
@@ -44,7 +44,7 @@ function GeneratorObjectNext() {
['[Generator].prototype.next', this]);
}
- // TODO(wingo): Implement.
+ return %_GeneratorSend(this, void 0);
}
function GeneratorObjectSend(value) {
@@ -53,7 +53,7 @@ function GeneratorObjectSend(value) {
['[Generator].prototype.send', this]);
}
- // TODO(wingo): Implement.
+ return %_GeneratorSend(this, value);
}
function GeneratorObjectThrow(exn) {
@@ -62,16 +62,7 @@ function GeneratorObjectThrow(exn) {
['[Generator].prototype.throw', this]);
}
- // TODO(wingo): Implement.
-}
-
-function GeneratorObjectClose() {
- if (!IS_GENERATOR(this)) {
- throw MakeTypeError('incompatible_method_receiver',
- ['[Generator].prototype.close', this]);
- }
-
- // TODO(wingo): Implement.
+ return %_GeneratorThrow(this, exn);
}
function SetUpGenerators() {
@@ -81,8 +72,7 @@ function SetUpGenerators() {
DONT_ENUM | DONT_DELETE | READ_ONLY,
["next", GeneratorObjectNext,
"send", GeneratorObjectSend,
- "throw", GeneratorObjectThrow,
- "close", GeneratorObjectClose]);
+ "throw", GeneratorObjectThrow]);
%SetProperty(GeneratorObjectPrototype, "constructor",
GeneratorFunctionPrototype, DONT_ENUM | DONT_DELETE | READ_ONLY);
%SetPrototype(GeneratorFunctionPrototype, $Function.prototype);
« no previous file with comments | « src/full-codegen.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698