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

Unified Diff: src/generator.js

Issue 14262004: Generator objects have [[Class]] === "Generator" (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Address review comments 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
Index: src/generator.js
diff --git a/src/generator.js b/src/generator.js
index d579928cbae74531af80108f12f62ecd1fb4048b..481d4d37f88f4d2ce3541b5ae04ff13495a4c998 100644
--- a/src/generator.js
+++ b/src/generator.js
@@ -39,18 +39,38 @@
// http://wiki.ecmascript.org/lib/exe/fetch.php?cache=cache&media=harmony:es6_generator_object_model_3-29-13.png
function GeneratorObjectNext() {
+ if (!IS_GENERATOR(this)) {
+ throw MakeTypeError('incompatible_method_receiver',
+ ['[Generator].prototype.next', this]);
+ }
+
// TODO(wingo): Implement.
}
function GeneratorObjectSend(value) {
+ if (!IS_GENERATOR(this)) {
+ throw MakeTypeError('incompatible_method_receiver',
+ ['[Generator].prototype.send', this]);
+ }
+
// TODO(wingo): Implement.
}
function GeneratorObjectThrow(exn) {
+ if (!IS_GENERATOR(this)) {
+ throw MakeTypeError('incompatible_method_receiver',
+ ['[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.
}
« no previous file with comments | « src/factory.cc ('k') | src/heap.h » ('j') | test/mjsunit/harmony/generators-objects.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698