Closed
Bug 72908
Opened 24 years ago
Closed 24 years ago
document support for [function] interfaces
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla0.9.1
People
(Reporter: jband_mozilla, Assigned: jband_mozilla)
Details
Attachments
(2 files)
6.78 KB,
patch
|
Details | Diff | Splinter Review | |
6.78 KB,
patch
|
Details | Diff | Splinter Review |
I intend to add support to xpidl to mark [function] interfaces. The idea is that
such interfaces are used to implement backward compatible event sinks where the
old JS DOM would expect the event sink to be a function object (rather than an
object with named methods).
Marking an interface like...
[scriptable, function, uuid(...)]
...will indicate to xpconnect (and possibly other language mappings) that when
calling into the JS code implementing the interface it should try to use the
wrapped JSObject as a function rather than looking up the named function on the
JSObject.
This will allow DOM code to dispatch these calls to JS (or other) event sinks as
regular XPCOM calls. Other language mappings may choose to ignore this flag and
implement such sinks in the normal manner. This really exists for backward
compatibility.
I opted to have [function] pertain to the entire interface rather than just
selected methods. This is a somewhat arbitrary decision. I think it is better
because it designates the intended use of the entire interface.
I'll attach a patch that I intend to land soon on
jband_xpconnect_flattening_BRANCH.
If anyone has a serious problem with this then speak up.
A JS test that works against the patch (in xpcshell) looks like:
var Echo = new Components.Constructor(
"@mozilla.org/js/xpc/test/Echo;1", "nsIEcho");
var echo = new Echo();
function foo(s) {print("function called with s = '"+s+"'");}
echo.callFunction(foo, "some string");
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Comment 2•24 years ago
|
||
Assignee | ||
Comment 3•24 years ago
|
||
NOTE: Second diff is identical to the first. Submitted twice.
Assignee | ||
Comment 4•24 years ago
|
||
I just checked the changes into jband_xpconnect_flattening_BRANCH.
We can still hash this out before it hits the trunk.
Status: NEW → ASSIGNED
Assignee | ||
Updated•24 years ago
|
Target Milestone: --- → mozilla0.9.1
Assignee | ||
Updated•24 years ago
|
Summary: add support for [function] interfaces → document support for [function] interfaces
Assignee | ||
Comment 5•24 years ago
|
||
typelib spec updated.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•