fix(rest-spread): Do not require Symbol.iterator for strings (#9794)

This commit is contained in:
Carlos Lopez
2020-03-15 09:54:44 -04:00
committed by GitHub
parent 661ffbd830
commit 7b9bc7c28b
8 changed files with 22 additions and 6 deletions

View File

@@ -0,0 +1,9 @@
function sum(x, y, z) {
return x + y + z;
}
function test() {
var args = arguments;
return sum(...args);
}
expect(test(1, 2, 3)).toBe(6);

View File

@@ -0,0 +1,3 @@
{
"plugins": ["proposal-object-rest-spread"]
}

View File

@@ -0,0 +1,3 @@
expect([...'']).toHaveLength(0);
expect([...'abc']).toHaveLength(3);
expect([...'def']).toMatchObject(['d','e','f']);