Commit c7f3b357 authored by Tristan Cavelier's avatar Tristan Cavelier

Merge branch 'master'

parents 183547fb 83f6069e
...@@ -26,11 +26,10 @@ zip: ...@@ -26,11 +26,10 @@ zip:
@mkdir $(TMPDIR)/jio @mkdir $(TMPDIR)/jio
@mkdir $(TMPDIR)/jio/storage @mkdir $(TMPDIR)/jio/storage
@cp jio.js $(TMPDIR)/jio/ @cp jio.js $(TMPDIR)/jio/
@cp jiodate.js $(TMPDIR)/jio/
@cp jioquery.js $(TMPDIR)/jio/
@cp src/sha1.amd.js $(TMPDIR)/jio/ @cp src/sha1.amd.js $(TMPDIR)/jio/
@cp src/sha2.amd.js $(TMPDIR)/jio/ @cp src/sha2.amd.js $(TMPDIR)/jio/
@cp src/sha256.amd.js $(TMPDIR)/jio/ @cp src/sha256.amd.js $(TMPDIR)/jio/
@cp src/jio.date/jiodate.js $(TMPDIR)/jio/
@cp lib/rsvp/rsvp-custom.js $(TMPDIR)/jio/ @cp lib/rsvp/rsvp-custom.js $(TMPDIR)/jio/
@cp lib/rsvp/rsvp-custom.amd.js $(TMPDIR)/jio/ @cp lib/rsvp/rsvp-custom.amd.js $(TMPDIR)/jio/
@cp lib/jquery/jquery.js $(TMPDIR)/jio/ @cp lib/jquery/jquery.js $(TMPDIR)/jio/
......
...@@ -4773,8 +4773,17 @@ SimpleQuery.prototype.match = function (item) { ...@@ -4773,8 +4773,17 @@ SimpleQuery.prototype.match = function (item) {
cast_to = this._key_schema.cast_lookup[cast_to]; cast_to = this._key_schema.cast_lookup[cast_to];
} }
try {
value = cast_to(value); value = cast_to(value);
} catch (e) {
value = undefined;
}
try {
object_value = cast_to(object_value); object_value = cast_to(object_value);
} catch (e) {
object_value = undefined;
}
} }
} else { } else {
object_value = item[key]; object_value = item[key];
......
...@@ -159,8 +159,17 @@ SimpleQuery.prototype.match = function (item) { ...@@ -159,8 +159,17 @@ SimpleQuery.prototype.match = function (item) {
cast_to = this._key_schema.cast_lookup[cast_to]; cast_to = this._key_schema.cast_lookup[cast_to];
} }
try {
value = cast_to(value); value = cast_to(value);
} catch (e) {
value = undefined;
}
try {
object_value = cast_to(object_value); object_value = cast_to(object_value);
} catch (e) {
object_value = undefined;
}
} }
} else { } else {
object_value = item[key]; object_value = item[key];
......
...@@ -130,6 +130,10 @@ ...@@ -130,6 +130,10 @@
read_from: 'date', read_from: 'date',
cast_to: dateCast, cast_to: dateCast,
equal_match: sameYear equal_match: sameYear
},
broken: {
read_from: 'date',
cast_to: function () { throw new Error('Broken!'); }
} }
}; };
...@@ -178,6 +182,19 @@ ...@@ -178,6 +182,19 @@
}) })
); );
promise.push(
jIO.QueryFactory.create({
type: 'simple',
key: keys.broken,
value: '2013-02-10'
}).
exec(docList()).
then(function (dl) {
deepEqual(dl.length, 0,
'Constructors that throw exceptions should not break a query, but silently fail comparisons');
})
);
RSVP.all(promise).then(noop).always(start); RSVP.all(promise).then(noop).always(start);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment