-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array destructuring transpiles into incompatible code #30
Comments
I ran across this today lol. Should probably be mentioned in the README. Luckily I dind't spent too much time debugging it (which is kinda hard, since it appears almost from nowhere). However, I found out that having certain panels open (?) allows you to use the Array.isArray function. |
Yeah good idea, let me add a PR for updating the readme 👍 As for having panels open, scripts have access to the global object, so some may modify the global Array prototype to add |
@timhaywood @mgomez-tubs thanks for brining this up! Built-in and custom Ponyfills have been implemented in 0.4.0 (see the Readme for details). I've added a Ponyfill for Let me know if you run into any other issues. 🍻 |
resolved in d3ca479 |
Amazing, thanks Justin! |
Unfortunetly, babel (purposefully) transpiles array destructuring into code that uses
Array.isArray
, even if that's not available in the target environment.More info in this issue on the babel repo:
babel/babel#11195
Don't expect a fix or anything, just wanted to call it out in case you hadn't run across it and wanted to call it out as a known limiation in the README or something.
I've just replaced the destructuring in my scripts manually.
Appreciate your hard work! Feel free to close without comment :)
The text was updated successfully, but these errors were encountered: