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

IE11 DataError on eachBy with no options #36

Open
jrzerr opened this issue May 28, 2015 · 3 comments
Open

IE11 DataError on eachBy with no options #36

jrzerr opened this issue May 28, 2015 · 3 comments
Labels
Milestone

Comments

@jrzerr
Copy link

jrzerr commented May 28, 2015

I got a DataError (code 0) on IE11 Edge when using the eachBy on an index but I did not pass any options. I am calling eachBy without the second parameter, like eachBy("indexName"). The problem is that when the query keyRange is set using:

                    ObjectStore.prototype.eachBy = function(indexName, options) {
                        ...
                        q = new Query();
                        ...
                        q.keyRange = keyRangeForOptions(options);
                        ...
                    };

The keyRangeForOptions function does not return anything in the case when options is not specified. This does not appear to affect Chrome or Firefox as I've been using the code for a while. However, I found that IE11 will not work with an undefined keyRange, it must be set to null. So my fix was to change:

                keyRangeForOptions = function(options) {
                    if (options.beginKey && options.endKey) {
                        return IDBKeyRange.bound(options.beginKey, options.endKey);
                    }
                };

to:

                keyRangeForOptions = function(options) {
                    if (options.beginKey && options.endKey) {
                        return IDBKeyRange.bound(options.beginKey, options.endKey);
                    } else {
                        return null;
                    }
                };

I will work on a Pull Request when I get time. I just wanted to make sure I documented it here so have a record of what the fix was.

@bramski
Copy link
Owner

bramski commented May 28, 2015

👍

@bramski
Copy link
Owner

bramski commented May 28, 2015

I'll add a milestone to the project for IE11 support. There's another issue in that realm.

@bramski bramski added this to the IE11 milestone May 28, 2015
@bramski bramski added the bug label May 28, 2015
@jrzerr
Copy link
Author

jrzerr commented May 28, 2015

I found this one after I used #34 to fix my first IE11 error. Thanks!

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

No branches or pull requests

2 participants