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

TypeError related to IDBCursor.PREV #43

Open
lovett opened this issue Jun 27, 2013 · 1 comment
Open

TypeError related to IDBCursor.PREV #43

lovett opened this issue Jun 27, 2013 · 1 comment

Comments

@lovett
Copy link
Contributor

lovett commented Jun 27, 2013

There's a minor flaw with the IndexedDB object detection logic. IDBCursor is set to either window.IDBCursor or window.webkitIDBCursor, but if neither of these exist there is no fallback. That's not so bad by itself, but it means the subsequent attempt to set IDBCursor.PREV and IDBCursor.NEXT may throw a type error because they are setting a property on an undefined value.

I ran across this in an application that bundles jquery.indexeddb.js into a larger file that concatenates several libraries. This causes clients that don't support IndexedDB to receive this file even though they don't otherwise invoke it. The ones without support throw the type error because they still perform the object detection.

This could be fixed by setting IDBCursor to a an empty object if nothing more suitable is available. Or alternately by not setting prev and next if IDBCursor is undefined.

@axemclion
Copy link
Owner

This is a good suggestion. @lovett, can you please send a pull request for this to the incoming-pr branch ?

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