Closed Bug 32724 Opened 25 years ago Closed 25 years ago

No support for scriptable 'overloaded' functions

Categories

(SeaMonkey :: General, enhancement, P3)

x86
Windows 2000
enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sean, Assigned: brendan)

Details

Attachments

(1 file)

The old netscape plugin API allowed overloaded javascript functions for plugins. IDL does not support function overloads. MS works around the overload issue in its IDL implementation thru the use of the VARIANT datatype. XPIDL does not allow methods which use native types (for example, nsXPTCMiniVariant) to be scriptable. A potential work-around for this might be to support var args in the mozilla IDL implementation (and in the javascript engine if it's not already there...). Or make an exception to the XPIDL native type rule for nsXPTCVariant. If a work-around is not available, legacy web content which calls into any of a plugin's overloaded javascript methods will not work in mozilla.
marking this as an enhancement and cc-ing mccabe. Mike can you comment and/or take ownership?
Severity: normal → enhancement
Component: XPCOM → All
Target Milestone: ---
Sean, can you remind us old-timers (who forget) and all the newcomers (who never knew) exactly how the old plugin API allowed and supported "overloaded" JS functions? Thanks, /be
Adding jband to the cc list.
The old LiveConnect API was based on creating a java shim that mediated calls between javascript and the c/c++ plugin. A class was created in java which could have overloaded methods. I don't know how the javascript engine resolved the object's method overloads... Search for "play" in music-object.js (the javascript that wraps the Beatnik Plugin) to see overloading at work in javascript.
Looks like nsIXPCScriptable may be the solution I'll need for this (thanks to an October 99 post I came across in netscape.public.mozilla.xpcom by jband!). I've confirmed the solution works when my plugin is loaded as a component (non- embed). However, due to http://bugzilla.mozilla.org/show_bug.cgi?id=32150 I can't confirm it works when the plugin is embedded.
assigning to brendan
Assignee: endico → brendan
QA Contact: nobody → endico
Sean, can we close this and just leave 32150 open to track your other problem?
OK by me to close it. Thanks.
Closing as FIXED.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
moving from architecture product to Browser. Architecture product is going away.
Component: All → Browser-General
Product: Architecture → Browser
Version: 5.0 → other
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: