Chromium Code Reviews| Index: test/mjsunit/harmony/generators-objects.js |
| diff --git a/test/mjsunit/harmony/generators-instantiation.js b/test/mjsunit/harmony/generators-objects.js |
| similarity index 79% |
| rename from test/mjsunit/harmony/generators-instantiation.js |
| rename to test/mjsunit/harmony/generators-objects.js |
| index 1255f9705c479c5966cf916e378aef06033b8b7a..ce6168c704659e9722a27591dc4801b4c0c21324 100644 |
| --- a/test/mjsunit/harmony/generators-instantiation.js |
| +++ b/test/mjsunit/harmony/generators-objects.js |
| @@ -45,5 +45,23 @@ function TestContextAllocation() { |
| g4(); |
| g5(["foo"]); |
| } |
| - |
| TestContextAllocation(); |
| + |
|
Michael Starzinger
2013/04/11 19:17:39
nit: Add a second empty newline between the two te
wingo
2013/04/12 10:50:17
Done.
|
| +// Test the properties and prototype of a generator object. |
| +function TestGeneratorObject() { |
| + function* g() { yield 1; } |
| + |
| + var iter = g(); |
| + assertSame(g.prototype, Object.getPrototypeOf(iter)); |
| + assertTrue(iter instanceof g); |
| + assertEquals([], Object.getOwnPropertyNames(iter)); |
| + assertTrue(iter !== g()); |
| + |
| + // g() is the same as new g(). |
| + iter = new g(); |
| + assertSame(g.prototype, Object.getPrototypeOf(iter)); |
| + assertTrue(iter instanceof g); |
| + assertEquals([], Object.getOwnPropertyNames(iter)); |
| + assertTrue(iter !== new g()); |
| +} |
| +TestGeneratorObject(); |