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

IE8 support broken in v0.9.1: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 #202

Closed
Oechslin opened this issue Jul 8, 2014 · 11 comments · Fixed by #217

Comments

@Oechslin
Copy link

Oechslin commented Jul 8, 2014

Trying to load version 0.9.1 of ...

  • localforage.js
  • localforage.min.js
  • localforage.nopromises.js
  • localforage.nopromises.min.js

... with Internet Explorer 8 or IE8 Browser Mode will fail and produce one of the following javascript errors:

SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28
SCRIPT1010: Expected identifier: localforage.js, line 1 character 7660
SCRIPT1010: Expected identifier: localforage.nopromises.js, line 331 character 28
SCRIPT1010: Expected identifier: localforage.nopromises.min.js, line 1 character 2483

Internet Explorer 8 doesn't like the following line:

cursor.continue();

https://github.com/mozilla/localForage/blob/master/dist/localforage.js#L1014
https://github.com/mozilla/localForage/blob/master/dist/localforage.nopromises.js#L331
https://github.com/mozilla/localForage/blob/master/src/drivers/indexeddb.js#L325

@tofumatt
Copy link
Member

tofumatt commented Jul 8, 2014

Interesting, cordova doesn't like that either. I wonder if the same ['continue'] trick we do with .delete would work?

tofumatt (Sent from mobile)

On July 8, 2014 12:53:20 AM EDT, Oechslin notifications@github.com wrote:

Trying to load version 0.9.1 of ...

  • localforage.js
  • localforage.min.js
  • localforage.nopromises.js
  • localforage.nopromises.min.js

... in Internet Explorer 8 or IE8 Browser Mode will fail and
produce one of the following javascript errors:

SCRIPT1010: Expected identifier: localforage.js, line 1014 character
28
SCRIPT1010: Expected identifier: localforage.js, line 1 character
7660
SCRIPT1010: Expected identifier: localforage.nopromises.js, line 331
character 28
SCRIPT1010: Expected identifier: localforage.nopromises.min.js, line
1 character 2483

Internet Explorer 8 doesn't like the following line:

cursor.continue();

Reply to this email directly or view it on GitHub:
#202

@Oechslin Oechslin changed the title LocalForage 0.9.1: IE8: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 LocalForage v0.9.1: IE8: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 Jul 8, 2014
@Oechslin Oechslin changed the title LocalForage v0.9.1: IE8: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 IE8 compatibility broken in version 0.9.1:: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 Jul 8, 2014
@Oechslin Oechslin changed the title IE8 compatibility broken in version 0.9.1:: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 IE8 compatibility broken in version 0.9.1: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 Jul 8, 2014
@Oechslin Oechslin changed the title IE8 compatibility broken in version 0.9.1: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 IE8 support broken in version 0.9.1: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 Jul 8, 2014
@Oechslin Oechslin changed the title IE8 support broken in version 0.9.1: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 IE8 support broken in v0.9.1: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 Jul 8, 2014
@Oechslin Oechslin changed the title IE8 support broken in v0.9.1: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 IE8 support broken in LF v0.9.1: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 Jul 8, 2014
@Oechslin Oechslin changed the title IE8 support broken in LF v0.9.1: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 IE8 support broken in v0.9.1: Error: SCRIPT1010: Expected identifier: localforage.js, line 1014 character 28 & localforage.nopromises.js, line 331 character 28 Jul 8, 2014
@jussi-kalliokoski
Copy link

That should do the trick to fix this particular issue. There should probably be a tool that automatically fixes these, I keep making the same class of IE8 bugs myself all the time. :/

@jussi-kalliokoski
Copy link

Apparently JSHint's es3 option should help with preventing this class of errors.

@tofumatt
Copy link
Member

tofumatt commented Jul 9, 2014

Oh, nice. I should enable that option, as JSHint is already part of the test suite. Thanks.

  • Matt

On Jul 9, 2014, at 3:32, Jussi Kalliokoski notifications@github.com wrote:

Apparently JSHint's es3 option should help with preventing this class of errors.


Reply to this email directly or view it on GitHub.

tofumatt added a commit that referenced this issue Jul 25, 2014
Allows us to write sane-looking code that is converted
to IE8 and Cordova-friendly ES3-type code without reserved
keywords at build-time.

* Fix #201
* Fix #202
@tofumatt
Copy link
Member

I didn't end up enabling the es3 option for everything as I used a build step instead, but I think I'll add a JSHint including es3 for the built versions, just to be safe.

@tofumatt
Copy link
Member

On second thought that's probably extra paranoid, but either way this is fixed now.

@jussi-kalliokoski
Copy link

Yeah, probably a better way to tackle the issue, and I agree on extra paranoid, you have to trust the tools you pick. ;) Speaking of which, what is the tool you used for the build step?

@jussi-kalliokoski
Copy link

Ah, nevermind, should've read the commit message.

@jussi-kalliokoski
Copy link

Although, es3-safe-recast only seems to address reserved word issue, but other issues such as trailing commas will go unnoticed without the es3 jshint option. :/

tofumatt added a commit that referenced this issue Jul 27, 2014
@tofumatt
Copy link
Member

I added a check for trailing commas in the style checker; I don't want to write the source files in ES3 mode but would rather just convert them during the build step, as writing ES3-compliant JS feels awkward. I hope this should fix everything! :-)

@tariq7
Copy link

tariq7 commented Dec 12, 2014

Hi everyone. i've installed correctly with ionic and cordova and it is working fine for me in chrome web, safari on mac and on my iPhone 6 plus ios8. however, on my iPhone 4, iOS 7 and on android s3 4.2.2 I am getting this error

TypeError: 'undefined' is not a constructor (evaluating 'new Promise'), http://192.168.0.2:8100/js/localforage.js, Line: 1778

I've updated everything and I am using the latest version of local forage and angular-locaforage . Any ideas as to why its not working? Because of this error, the whole app fails to run.

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

Successfully merging a pull request may close this issue.

4 participants