add regenerator parameter tests

This commit is contained in:
Sebastian McKenzie 2015-01-28 23:45:11 +11:00
parent 5ffaeb5e9f
commit 7894f1a079
3 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,6 @@
function* foo(foo = "bar") {
return foo;
}
assert.deepEqual(foo().next().value, "bar");
assert.deepEqual(foo("foo").next().value, "foo");

View File

@ -0,0 +1,5 @@
function* foo({ foo }) {
return foo;
}
assert(foo({ foo: "bar" }).next().value, "bar");

View File

@ -0,0 +1,5 @@
function* foo(...items) {
return items;
}
assert.deepEqual(foo(1, 2, 3).next().value, [1, 2, 3]);