bublejs / buble

https://buble.surge.sh
MIT License
871 stars 67 forks source link

Can't handler destructuring #223

Closed Hilbertangers closed 5 years ago

Hilbertangers commented 5 years ago

transpile [...Array(2)], expect[undefined, undefined], but [].concat(Array(2)) === []

because Iterators is Dangerous?

mourner commented 5 years ago

This specific case looks fine to me:

image
Hilbertangers commented 5 years ago

emmmm..... image i use V8,What about you? @mourner

mourner commented 5 years ago

@Hilbertangers it's true that this is not perfectly equivalent — but this makes the issue a duplicate of #81.

However, if you're surprised that [] === [] is false, here's an article on how comparison operators work: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Using_the_equality_operators