Add a rule that prevents calling some Array and String accessor methods without using the return value

RESOLVED FIXED in Firefox 66

Status

enhancement
RESOLVED FIXED
6 months ago
6 months ago

People

(Reporter: jaws, Assigned: jaws)

Tracking

(Depends on 1 bug, Blocks 1 bug)

Trunk
mozilla66
Dependency tree / graph

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

A few places in our codebase we have code that does the following:

foo.concat(bar);
foo.slice(2);
foo.join(" ");

The three above expressions will leave foo unchanged, however it appears that it will be mutated on each line.

Summary: Add a rule that prevents calling some Array accessor methods without using the return value → Add a rule that prevents calling some Array and String accessor methods without using the return value
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c9f087ff5a52
Add a rule that prevents calling some Array and String accessor methods without using the return value. r=Standard8
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b8b0f4d2fa2c
Fix the test message in the use-returnValue.js test. r=Standard8
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ee28acf1382f
The testcases are ExpressionStatements that include MemberExpressions, not just MemberExpressions. r=MattN
Backout by shindli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ce496fde2edd
Backed out changeset ee28acf1382f for X2 / TV failures CLOSED TREE
https://hg.mozilla.org/integration/autoland/rev/02b9e7149911
Backed out changeset b8b0f4d2fa2c for X2 / TV failures CLOSED TREE
https://hg.mozilla.org/integration/autoland/rev/9d2e8060ccde
Backed out changeset c9f087ff5a52 for X2 / TV failures CLOSED TREE
Attachment #9037663 - Attachment description: Bug 1521170 - Add a rule that prevents calling some Array and String accessor methods without using the return value. r?Standard8 → Bug 1521170 - Add a rule that prevents calling some Array and String accessor methods without using the return value. r?Standard8,Gijs
Attachment #9038383 - Attachment is obsolete: true
Attachment #9038392 - Attachment is obsolete: true
Flags: needinfo?(jaws)
Depends on: 1522134
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f6094ca026ad
Add a rule that prevents calling some Array and String accessor methods without using the return value. r=Standard8,Gijs
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.