iOS SeaMonkey: "Promise is not defined", browser works fine

Looks like the JS interpreter that iOS uses doesn’t support Promises, is this true?

Well the spidermonkey fork is over 2 years old so chances are its spidermonkey that doesn’t support promises and the browser that does.

Why is it so old? Two years in tech is ancient.

Probably effort to update to v45 currently its on v38, your more than welcome to attempt to upgrade the cocos2d-x version to the latest. Patches are provided by the original repo and associated wiki.

Remembering that the javascript engine is a customised port of the spidermonkey js engine.

I am unsure of how many man hours it would take to update.

as quoted from the mozilla website

Mozilla has no plans to keep the JSAPI stable for embedders. We have instead chosen to concentrate on overall performance and accuracy as our primary concerns.

Ideally, it should take very little, assuming good modular software design. Maybe I can give it a shot as a weekend project? If there are roadblocks, I’ll be sure to let everyone know.

1 Like

SpiderMonkey change their API almost every release, it’s very hard to keep up.

SpiderMonkey releases only once a year if that, and they provide extensive release notes documenting the API changes (the most recent update to version 45 looked fairly manageable).

It actually sounds pretty doable, and it’s a pretty reasonable expectation for someone using a library to put in the effort to stay current with it.

Right now, the situation is bad when various platforms expose different and wildly inconsistent JS implementations, especially if iOS is many years behind and out-of-date.

I agree with you, just complaining about their constantly changing API :slight_smile:

1 Like

Maybe it’s possible to use something like Babel for this?

We just use bluebird library and it works fine.

1 Like