Closed
Bug 1748874
Opened 3 years ago
Closed 3 years ago
Require MOZ_CAN_RUN_SCRIPT to go to declarations
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Developer Infrastructure
Source Code Analysis
Tracking
(firefox97 wontfix, firefox98 fixed)
RESOLVED
FIXED
98 Branch
People
(Reporter: saschanaz, Assigned: saschanaz)
References
Details
Attachments
(5 files)
For example, https://phabricator.services.mozilla.com/D135160?id=525055 put it all to .cpp and it seems nothing warns about it.
Comment 1•3 years ago
|
||
to be clear, you would like a linter doing some kind of
if grep -q MOZ_CAN_RUN_SCRIPT *.cpp; then
echo "please move MOZ_CAN_RUN_SCRIPT into the header files"
exit 1
fi
?
Assignee | ||
Comment 2•3 years ago
•
|
||
It's a little bit complex than that, the thumb rule is that the declaration should get it, not the definition. That means there's no problem if the definition itself is a declaration.
// No problem, everything is good
MOZ_CAN_RUN_SCRIPT static void foo();
static void bar() { // MOZ_CAN_RUN_SCRIPT error as expected
foo();
}
static void foo();
static void bar() {
foo(); // !! bar() doesn't know foo is MOZ_CAN_RUN_SCRIPT
}
MOZ_CAN_RUN_SCRIPT foo() {};
Assignee | ||
Updated•3 years ago
|
Summary: Require MOZ_CAN_RUN_SCRIPT to go to headers whenever possible → Require MOZ_CAN_RUN_SCRIPT to go to declarations
Assignee | ||
Updated•3 years ago
|
Assignee: nobody → krosylight
Assignee | ||
Comment 3•3 years ago
|
||
Assignee | ||
Comment 4•3 years ago
|
||
Depends on D135400
Assignee | ||
Comment 5•3 years ago
|
||
Depends on D135402
Assignee | ||
Comment 6•3 years ago
|
||
Depends on D135403
Assignee | ||
Comment 7•3 years ago
|
||
Depends on D135404
Pushed by krosylight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/12073baa49f0
Part 4: Move MOZ_CAN_RUN_SCRIPT to declarations in dom/streams r=mgaudet
Comment 9•3 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 3 years ago
status-firefox97:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
Assignee | ||
Comment 10•3 years ago
|
||
(There are other patches)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•3 years ago
|
Comment 11•3 years ago
|
||
Pushed by krosylight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/018d59d42d1d
Part 1: Mark the decl of HTMLCanvasElement::CallPrintCallback as CAN_RUN_SCRIPT r=masayuki
https://hg.mozilla.org/integration/autoland/rev/eb8e0e968c3b
Part 2: Mark SessionStoreUtils method decls as CAN_RUN_SCRIPT r=masayuki
https://hg.mozilla.org/integration/autoland/rev/69cf4aea9436
Part 3: Mark the decl of SessionStoreRestoreData::RestoreInto as CAN_RUN_SCRIPT r=masayuki
https://hg.mozilla.org/integration/autoland/rev/418b53fbd23d
Part 5: Require CAN_RUN_SCRIPT to be at the first declaration r=andi
Comment 12•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/018d59d42d1d
https://hg.mozilla.org/mozilla-central/rev/eb8e0e968c3b
https://hg.mozilla.org/mozilla-central/rev/69cf4aea9436
https://hg.mozilla.org/mozilla-central/rev/418b53fbd23d
Status: REOPENED → RESOLVED
Closed: 3 years ago → 3 years ago
status-firefox98:
--- → fixed
Resolution: --- → FIXED
Updated•3 years ago
|
Target Milestone: 97 Branch → 98 Branch
Updated•3 years ago
|
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•