-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
8da9d8b
commit b64cb9a
Showing
5 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ges/babel-plugin-transform-destructuring/test/fixtures/destructuring/non-iterable/exec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters