Permalink
Browse files

Fix an IDBDatabase exception in objectstore.

Chrome 21 throws an IDBDatabase exception 21 (TYPE_ERR) when passing an undefined direction to store.openCursor.

R=nweiz
DELTA=6  (3 added, 0 deleted, 3 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=5165


git-svn-id: http://closure-library.googlecode.com/svn/trunk@2045 0b95b8e8-c90f-11de-9d4f-f947ee5921c8
  • Loading branch information...
1 parent ce108cd commit a5de5f113a6c1a05fb628ae473f69be6e13f2759 ofir@google.com committed Jul 17, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 closure/goog/db/objectstore.js
@@ -291,9 +291,12 @@ goog.db.ObjectStore.prototype.openCursor = function(opt_range, opt_direction) {
var request;
try {
- request = this.store_.openCursor(
- opt_range ? opt_range.range_ : null,
- opt_direction);
+ var range = opt_range ? opt_range.range_ : null;
+ if (opt_direction) {
+ request = this.store_.openCursor(range, opt_direction);
+ } else {
+ request = this.store_.openCursor(range);
+ }
} catch (err) {
throw new goog.db.Error(err.code, msg);
}

0 comments on commit a5de5f1

Please sign in to comment.