Closed
Bug 1582567
Opened 5 years ago
Closed 5 years ago
webidl-example shouldn't generate virtual and override at the same time
Categories
(Core :: DOM: Bindings (WebIDL), defect, P1)
Core
DOM: Bindings (WebIDL)
Tracking
()
RESOLVED
FIXED
mozilla71
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: chunmin, Assigned: bzbarsky)
Details
Attachments
(1 file)
Given a .webidl file like
interface Foo {
void bar();
};
The generated example .h file will have a function that marks virtual
and override
at the same time.
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
The virtual
can be omitted if the function has override
.
Assignee | ||
Comment 1•5 years ago
|
||
The virtual can be omitted if the function has override.
Not only can, but should: see https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Methods where is says:
Method declarations must use, at most, one of the following keywords: virtual, override, or final.
Assignee | ||
Updated•5 years ago
|
Priority: -- → P1
Assignee | ||
Comment 2•5 years ago
|
||
Reporter | ||
Comment 3•5 years ago
|
||
Should we clear this wrong pattern in the codebase either in this bug? For example, I see
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/63c45794f766 Stop emitting 'virtual' in codegen if we're already emitting 'override'. r=edgar
Comment 5•5 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox71:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Updated•5 years ago
|
Assignee: nobody → bzbarsky
You need to log in
before you can comment on or make changes to this bug.
Description
•