Closed Bug 1521170 Opened 2 years ago Closed 2 years ago

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

Categories

(Firefox Build System :: Lint and Formatting, enhancement)

enhancement
Not set
normal

Tracking

(firefox66 fixed)

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: jaws, Assigned: jaws)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

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: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.