Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tomáš Peterka
jio
Commits
98cf075d
Commit
98cf075d
authored
Jan 03, 2014
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comparisons with undefined are always false
parent
1ebfd26d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
30 deletions
+3
-30
src/queries/core/simplequery.js
src/queries/core/simplequery.js
+3
-30
No files found.
src/queries/core/simplequery.js
View file @
98cf075d
...
@@ -152,6 +152,9 @@ SimpleQuery.prototype.match = function (item, wildcard_character) {
...
@@ -152,6 +152,9 @@ SimpleQuery.prototype.match = function (item, wildcard_character) {
object_value
=
item
[
key
];
object_value
=
item
[
key
];
value
=
this
.
value
;
value
=
this
.
value
;
}
}
if
(
object_value
===
undefined
||
value
===
undefined
)
{
return
RSVP
.
resolve
(
false
);
}
return
matchMethod
(
object_value
,
value
,
wildcard_character
);
return
matchMethod
(
object_value
,
value
,
wildcard_character
);
};
};
...
@@ -195,15 +198,6 @@ SimpleQuery.prototype["="] = function (object_value, comparison_value,
...
@@ -195,15 +198,6 @@ SimpleQuery.prototype["="] = function (object_value, comparison_value,
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
comparison_value
===
undefined
)
{
if
(
value
===
undefined
)
{
return
RSVP
.
resolve
(
true
);
}
return
RSVP
.
resolve
(
false
);
}
if
(
value
===
undefined
)
{
return
RSVP
.
resolve
(
false
);
}
if
(
value
.
cmp
!==
undefined
)
{
if
(
value
.
cmp
!==
undefined
)
{
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
,
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
,
wildcard_character
)
===
0
);
wildcard_character
)
===
0
);
...
@@ -240,15 +234,6 @@ SimpleQuery.prototype["!="] = function (object_value, comparison_value,
...
@@ -240,15 +234,6 @@ SimpleQuery.prototype["!="] = function (object_value, comparison_value,
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
comparison_value
===
undefined
)
{
if
(
value
===
undefined
)
{
return
RSVP
.
resolve
(
false
);
}
return
RSVP
.
resolve
(
true
);
}
if
(
value
===
undefined
)
{
return
RSVP
.
resolve
(
true
);
}
if
(
value
.
cmp
!==
undefined
)
{
if
(
value
.
cmp
!==
undefined
)
{
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
,
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
,
wildcard_character
)
!==
0
);
wildcard_character
)
!==
0
);
...
@@ -282,9 +267,6 @@ SimpleQuery.prototype["<"] = function (object_value, comparison_value) {
...
@@ -282,9 +267,6 @@ SimpleQuery.prototype["<"] = function (object_value, comparison_value) {
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
value
===
undefined
||
comparison_value
===
undefined
)
{
return
RSVP
.
resolve
(
false
);
}
if
(
value
.
cmp
!==
undefined
)
{
if
(
value
.
cmp
!==
undefined
)
{
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
)
<
0
);
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
)
<
0
);
}
}
...
@@ -309,9 +291,6 @@ SimpleQuery.prototype["<="] = function (object_value, comparison_value) {
...
@@ -309,9 +291,6 @@ SimpleQuery.prototype["<="] = function (object_value, comparison_value) {
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
value
===
undefined
||
comparison_value
===
undefined
)
{
return
RSVP
.
resolve
(
false
);
}
if
(
value
.
cmp
!==
undefined
)
{
if
(
value
.
cmp
!==
undefined
)
{
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
)
<=
0
);
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
)
<=
0
);
}
}
...
@@ -336,9 +315,6 @@ SimpleQuery.prototype[">"] = function (object_value, comparison_value) {
...
@@ -336,9 +315,6 @@ SimpleQuery.prototype[">"] = function (object_value, comparison_value) {
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
value
===
undefined
||
comparison_value
===
undefined
)
{
return
RSVP
.
resolve
(
false
);
}
if
(
value
.
cmp
!==
undefined
)
{
if
(
value
.
cmp
!==
undefined
)
{
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
)
>
0
);
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
)
>
0
);
}
}
...
@@ -363,9 +339,6 @@ SimpleQuery.prototype[">="] = function (object_value, comparison_value) {
...
@@ -363,9 +339,6 @@ SimpleQuery.prototype[">="] = function (object_value, comparison_value) {
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
if
(
typeof
value
===
'
object
'
&&
value
.
hasOwnProperty
(
'
content
'
))
{
value
=
value
.
content
;
value
=
value
.
content
;
}
}
if
(
value
===
undefined
||
comparison_value
===
undefined
)
{
return
RSVP
.
resolve
(
false
);
}
if
(
value
.
cmp
!==
undefined
)
{
if
(
value
.
cmp
!==
undefined
)
{
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
)
>=
0
);
return
RSVP
.
resolve
(
value
.
cmp
(
comparison_value
)
>=
0
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment