Skip to content
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

Check for _babelPolyfill first #82

Open
r-murphy opened this issue May 12, 2016 · 3 comments
Open

Check for _babelPolyfill first #82

r-murphy opened this issue May 12, 2016 · 3 comments

Comments

@r-murphy
Copy link

Would it be possible to see if window._babelPolyfill is set before loading the babel polyfill? I use babel polyfill in my own site and then when I switch to Scratch JS, babel polyfill rejects with an exception and devtools jumps over to debugger mode and stops at a couple exception breakpoints. Also I get an error popup, but that's coming from my own app when in debug mode.

It only happens the first time I use Scratch JS in that tab.

Thanks

@richgilbank
Copy link
Owner

Oooh, good call. That makes sense, right now I believe it's just stomping on any existing version. Should be a fairly simple fix. I'll try to take a look in a bit, but in the meanwhile, this would be a good first bug for anyone interested in contributing!

@r-murphy
Copy link
Author

I took a shot at solving this. It's my first time developing on an extension so I'm not sure what's possible exactly. I added to the existing script insert condition. It would only support a one-liner rather than more complex logic, but it does the job. Let me know what you think.

I also found that the babel-polyfill npm dependency was missing so I added that and updated the path (it's no longer in babel-core).

Unrelated, I fixed the gulpfile in a separate commit. The del module returns a Promise now and doesn't seem to support the callback API anymore. Luckily gulp has Promise support.

@richgilbank
Copy link
Owner

Nice! Mind opening PRs for those commits? I just added babel-polyfill to the project to fix another bug, so the conditional script insertion commit may have to be rebased. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants