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

Throw error on old versions of OSX #6

Open
jemgold opened this issue Apr 3, 2017 · 3 comments
Open

Throw error on old versions of OSX #6

jemgold opened this issue Apr 3, 2017 · 3 comments

Comments

@jemgold
Copy link

jemgold commented Apr 3, 2017

I ran into a problem trying to use this on my 2nd laptop (which is running El Capitan, not Sierra). Turns out the version of JSContext on older OSXs doesn't support a bunch of things used here - const / let (which we can compile I guess), but also Promise (which we can't).

Probably a good idea to throw a descriptive error when the user is trying to run it on a platform without Promise?

@darknoon gave me this snippet to get JSC version - need to remember to run it this evening on my 2nd Mac to find out what our range is :)

log([NSBundle bundleForClass:JSContext].infoDictionary()["CFBundleVersion"])
@mathieudutour
Copy link
Member

Good point.

But why can't we polyfill Promise?

@zethussuen
Copy link

If I'm not mistaken, setImmediate is not available in older JSContext, hence the inability to polyfill. Could possibly fall back on setTimeout, but performance is quite bad.

@mathieudutour
Copy link
Member

setTimeout is not available anyway, but I have a polyfill already.

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

3 participants