Fix null comparisons in driver.js

RESOLVED FIXED in Firefox 40

Status

RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: ato, Assigned: ato)

Tracking

({pi-marionette-server})

unspecified
mozilla40
pi-marionette-server
Points:
---

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

4 years ago
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.
(Assignee)

Updated

4 years ago
Keywords: ateam-marionette-server
(Assignee)

Updated

4 years ago
Summary: Fix null comparisons → Fix null comparisons in driver.js
(Assignee)

Updated

4 years ago
Assignee: nobody → ato
Status: NEW → ASSIGNED
(Assignee)

Comment 2

4 years ago
Created 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 fb4179fe8fba5ccfee79984b8b5cdb4d8f40d7ae https://reviewboard-hg.mozilla.org/gecko/
Attachment #8597248 - Flags: review?(dave.hunt)
(Assignee)

Comment 3

4 years ago
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/
(Assignee)

Comment 5

4 years ago
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
Last Resolved: 4 years ago
status-firefox40: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
(Assignee)

Comment 9

3 years ago
Comment on attachment 8597248 [details]
MozReview Request: bz://1157258/ato
Attachment #8597248 - Attachment is obsolete: true
Attachment #8620112 - Flags: review+
(Assignee)

Comment 10

3 years ago
Created attachment 8620112 [details]
MozReview Request: Bug 1157258: Fix null type comparisons in driver.js
You need to log in before you can comment on or make changes to this bug.