Commit f3e3a9f0 authored by Marco Mariani's avatar Marco Mariani

pass wildcard_character to .cmp()

parent 1f88c5ad
......@@ -145,7 +145,7 @@ property, that behaves like the ``compareFunction`` described in
...
return {
...
'cmp': function (b) {
'cmp': function (b, wildcard_character) {
if (a < b) {
return -1;
}
......@@ -161,6 +161,7 @@ property, that behaves like the ``compareFunction`` described in
cast_to: myType
...
``wildcard_character`` is only passed by ``=`` and ``!=`` operators.
If the < or > comparison makes no sense for the objects, the function should return ``undefined``.
......
......@@ -205,7 +205,7 @@ SimpleQuery.prototype["="] = function (object_value, comparison_value,
return false;
}
if (value.cmp !== undefined) {
return value.cmp(comparison_value) === 0;
return value.cmp(comparison_value, wildcard_character) === 0;
}
if (
convertStringToRegExp(
......@@ -249,7 +249,7 @@ SimpleQuery.prototype["!="] = function (object_value, comparison_value,
return true;
}
if (value.cmp !== undefined) {
return value.cmp(comparison_value) !== 0;
return value.cmp(comparison_value, wildcard_character) !== 0;
}
if (
convertStringToRegExp(
......
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