block hoist assignment pattern destructuring - fixes #652

This commit is contained in:
Sebastian McKenzie
2015-02-01 18:33:36 +11:00
parent 2ff6dee0ec
commit 25566a24f6
2 changed files with 12 additions and 3 deletions

View File

@@ -3,4 +3,11 @@ function* foo() {
return bar;
}
assert.deepEqual(foo().next().value, "bar");
assert.equal(foo().next().value, "bar");
function *foo({ bar = 0 }) {
return bar;
}
assert.equal(foo({ bar: undefined }).next(), 0);
assert.equal(foo({ bar: 3 }).next(), 3);