Chromium Code Reviews| Index: src/generator.js |
| diff --git a/src/generator.js b/src/generator.js |
| index d579928cbae74531af80108f12f62ecd1fb4048b..89b76ee0acae2165abbda4e781cf31bbaca7bb01 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.next', this]); |
|
Michael Starzinger
2013/04/17 12:52:19
The error message should say "send" for the method
wingo
2013/04/17 14:23:51
Done.
|
| + } |
| + |
| // TODO(wingo): Implement. |
| } |
| function GeneratorObjectThrow(exn) { |
| + if (!IS_GENERATOR(this)) { |
| + throw MakeTypeError('incompatible_method_receiver', |
| + ['[Generator].prototype.next', this]); |
|
Michael Starzinger
2013/04/17 12:52:19
The error message should say "throw" for the metho
wingo
2013/04/17 14:23:51
Done.
|
| + } |
| + |
| // TODO(wingo): Implement. |
| } |
| function GeneratorObjectClose() { |
| + if (!IS_GENERATOR(this)) { |
| + throw MakeTypeError('incompatible_method_receiver', |
| + ['[Generator].prototype.next', this]); |
|
Michael Starzinger
2013/04/17 12:52:19
The error message should say "close" for the metho
wingo
2013/04/17 14:23:51
Done.
|
| + } |
| + |
| // TODO(wingo): Implement. |
| } |