Closed Bug 662341 Opened 13 years ago Closed 6 years ago

Better method signatures for [noscript, notxpcom] attributes (actually use return values)

Categories

(Core :: XPCOM, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

Recently I reviewed a patch which added some:

  [noscript, notxpcom] readonly attribute TimeStamp foo;

where TimeStamp is a mozilla::TimeStamp but the C++ generated header had a function with an out param instead of just returning a TimeStamp...  It would be really nice if we could use a return value here somehow.
The "normal" way to do this is:

[noscript, notxpcom] TimeStamp getFood();
Right; I'm just asking for this to Just Work the other way instead of having to have weird-looking IDL...
At this point using [notxpcom] on an attribute gives an error at IDL-processing time.

I'm just going to fix this, so people don't have to figure out the hard way that they need a method (or two, if not readonly) instead of an attribute.
Assignee: nobody → bzbarsky
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5beaad8a185b
Add support for [notxpcom] annotations on xpidl attributes.  r=nika
Flags: needinfo?(bzbarsky)
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/95393acee0ea
Add support for [notxpcom] annotations on xpidl attributes.  r=nika
https://hg.mozilla.org/mozilla-central/rev/95393acee0ea
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Blocks: 1507540
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: