Closed Bug 1157258 Opened 6 years ago Closed 6 years ago

Fix null comparisons in driver.js

Categories

(Testing :: Marionette, defect)

defect
Not set
normal

Tracking

(firefox40 fixed)

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: ato, Assigned: ato)

Details

(Keywords: pi-marionette-server)

Attachments

(1 file, 1 obsolete file)

When we compare using == against a variable, which value may theoretically be null, we should use absolute comparison through ===.

jshint and other linters complain about this and can be used to find instances we should fix.
Summary: Fix null comparisons → Fix null comparisons in driver.js
Assignee: nobody → ato
Status: NEW → ASSIGNED
Attached file MozReview Request: bz://1157258/ato (obsolete) —
/r/7609 - Bug 1157258: Fix null type comparisons in driver.js

Pull down this commit:

hg pull -r fb4179fe8fba5ccfee79984b8b5cdb4d8f40d7ae https://reviewboard-hg.mozilla.org/gecko/
Attachment #8597248 - Flags: review?(dave.hunt)
Comment on attachment 8597248 [details]
MozReview Request: bz://1157258/ato

/r/7609 - Bug 1157258: Fix null type comparisons in driver.js

Pull down this commit:

hg pull -r 9e828854e4a794aba9807ced38532eefafe8531f https://reviewboard-hg.mozilla.org/gecko/
Comment on attachment 8597248 [details]
MozReview Request: bz://1157258/ato

/r/7609 - Bug 1157258: Fix null type comparisons in driver.js

Pull down this commit:

hg pull -r 2608f3ccba3df22502dc8a9b872109307fbeafeb https://reviewboard-hg.mozilla.org/gecko/
Attachment #8597248 - Flags: review?(dave.hunt) → review+
Comment on attachment 8597248 [details]
MozReview Request: bz://1157258/ato

https://reviewboard.mozilla.org/r/7607/#review6391

::: testing/marionette/driver.js:1707
(Diff revision 3)
> -    if ((cmd.parameters.id == null) && (cmd.parameters.element == null)) {
> +    

Nit: Whitespace.

::: testing/marionette/driver.js:1710
(Diff revision 3)
> +    if (cmd.parameters.id == null && !cmd.parameters.hasOwnProperty("element")) {

Why not === null here?
https://hg.mozilla.org/mozilla-central/rev/4d4d52c7a067
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Attachment #8597248 - Attachment is obsolete: true
Attachment #8620112 - Flags: review+
You need to log in before you can comment on or make changes to this bug.