Open
Bug 1452011
Opened 7 years ago
Updated 2 years ago
XPIDL parser should probably reject [noscript] in non-[builtinclass] interface
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox61 | --- | affected |
People
(Reporter: xidorn, Unassigned)
References
(Depends on 1 open bug)
Details
It seems that it currently rejects [infallible] attributes in that case. I don't think [noscript] can be implemented by script... so probably they should be banned from non-[builtinclass] interfaces as well.
Reporter | ||
Comment 1•7 years ago
|
||
So it is not doable. At least nsINetAddr has implementation in JavaScript[1] while it also has [noscript] method[2].
I have no idea how this can work...
[1] https://searchfox.org/mozilla-central/rev/d0413b711da4dac72b237d0895daba2537f1514c/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js#259-264
[2] https://searchfox.org/mozilla-central/rev/d0413b711da4dac72b237d0895daba2537f1514c/netwerk/base/nsINetAddr.idl#87
![]() |
||
Comment 2•7 years ago
|
||
> I don't think [noscript] can be implemented by script...
Sure. Trying to call it on the C++ side on a JS implementation will return a failure nsresult.
That wasn't an option with [infallible], obviously. ;)
While it seems like it would be nice if people were clear on whether they expect their interface to be implemented in JS or not, one can sort of imagine a noscript API that you try first and if that fails try a scriptable API that might still do (part of?) what you want...
Comment 3•6 years ago
|
||
I could imagine some kind of "noscriptish" property that does the current fallback, and then a stronger noscript property that bans non-[builtinclass] interfaces. I don't know if that's worth the trouble. At a certain point, you might be better off deCOMing things.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•