Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#7125 closed defect (fixed)

Comma operator for dojo.query returning partial results

Reported by: ptwobrussell Owned by: alex
Priority: high Milestone: 1.3
Component: Query Version: 1.1.1
Keywords: Cc: ptwobrussell@…
Blocked By: Blocking:

Description

I'm finding that if I have a page with something like this in it:

<div id="a">a</div>
<div id="b">b</div>

that the statement dojo.query("#a,#q,#b") short-circuits and only returns #a if there isn't a #q in the page somewhere. AFAIK, that would be a bug since I've always understood the , operator to act like an OR statement, which would mean that you'd expect the result#a,#b to come back

I noticed this in the latest FF2 with the latest revision.

Attachments (4)

querybug.html (592 bytes) - added by dante 11 years ago.
query2.js.diff (1.4 KB) - added by nic 11 years ago.
[cla][patch] fixes the _zip function
query3.js.diff (1.4 KB) - added by nic 11 years ago.
a stupid detail: I prefer the "condition && (assignment)" syntax instead of "if(condition){ assignment }", n+6 chars vs n+8 :P
query.js.diff (1.5 KB) - added by nic 11 years ago.
[cla][patch] fixes my error in the previous patch and #7368 again

Download all attachments as: .zip

Change History (13)

comment:1 Changed 11 years ago by dylan

Milestone: tbd1.2
Owner: changed from anonymous to alx

comment:2 Changed 11 years ago by dylan

Owner: changed from alx to alex

comment:3 Changed 11 years ago by bill

Milestone: 1.21.3

as per today's meeting, punting these core bugs

Changed 11 years ago by dante

Attachment: querybug.html added

comment:4 Changed 11 years ago by dante

Priority: normalhigh

this hit me today, so I worked up a test case digging a little deeper. also seems related to #7368 ? also discovered in current trunk the #q, #a example throws and error, whereas #a, #q, #b simply stops on #q silently.

Changed 11 years ago by nic

Attachment: query2.js.diff added

[cla][patch] fixes the _zip function

Changed 11 years ago by nic

Attachment: query3.js.diff added

a stupid detail: I prefer the "condition && (assignment)" syntax instead of "if(condition){ assignment }", n+6 chars vs n+8 :P

comment:5 Changed 11 years ago by nic

This bug and #7368 are unrelated

Changed 11 years ago by nic

Attachment: query.js.diff added

[cla][patch] fixes my error in the previous patch and #7368 again

comment:6 Changed 11 years ago by alex

Status: newassigned

good patch, thanks for updating for the new engine. I will apply.

comment:7 Changed 11 years ago by alex

(In [16617]) test case for #7125. Refs #7125

comment:8 Changed 11 years ago by alex

Resolution: fixed
Status: assignedclosed

(In [16618]) make sure that null lists don't fool us in the DOM branch + test. Fixes #7125. !strict

comment:9 Changed 10 years ago by bill

Component: CoreQuery
Note: See TracTickets for help on using tickets.