fix: early return when instance is not iterable (#10396)
* fix: early return when instance is not iterable * chore: update test fixtures * fix: gaurd against arguments for old browsers
This commit is contained in:
committed by
Nicolò Ribaudo
parent
8da9d8b4b8
commit
b64cb9aaf1
@@ -0,0 +1,9 @@
|
||||
expect(
|
||||
() => {
|
||||
var [foo, bar] = undefined;
|
||||
}).toThrow("Invalid attempt to destructure non-iterable instance");
|
||||
|
||||
expect(
|
||||
() => {
|
||||
var foo = [ ...undefined ];
|
||||
}).toThrow("Invalid attempt to spread non-iterable instance");
|
||||
Reference in New Issue
Block a user