Merge pull request #3300 from gzzhanghao/gen-fix

Fix generators with default args
This commit is contained in:
Amjad Masad 2016-02-03 15:46:39 -08:00
commit 6bb7eb0c78
3 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,8 @@
class Test {
*iter(arg = this) {
yield arg;
}
}
let test = new Test;
assert.equal(test.iter().next().value, test);

View File

@ -0,0 +1,5 @@
{
"presets": [
"es2015"
]
}

View File

@ -105,6 +105,9 @@ export default class TraversalContext {
path.resync();
path.pushContext(this);
// this path no longer belongs to the tree
if (path.key === null) continue;
if (testing && queue.length >= 1000) {
this.trap = true;
}