I think you want yourPrivateObject.__DOM_IMPL__, which gives you the
binding object as seen by client script.

bholley


On Tue, Nov 5, 2013 at 7:16 AM, Fabrice DesrĂ© <[email protected]> wrote:

>  In the download api we are working on for b2g, a download event in webidl
> looks like:
>
> [Constructor(DOMString type, optional DownloadEventInit eventInitDict)]
> interface DownloadEvent : Event
> {
>   readonly attribute DOMDownload? download;
> };
>
> dictionary DownloadEventInit : EventInit
> {
>   DOMDownload? download = null;
> };
>
> DOMDownload is also defined in webidl, and has no xpidl equivalent, but
> has a js/xpcom implementation.
>
> I'm creating a download event with :
> let event = new this._window.DownloadEvent("downloadstarted", {
>           download: createDOMDowloadObject(this._window, data)
>         });
>
> where createDOMDownloadObject() returns a xpcom object implementing the
> webidl interface. However this fails with this error:
> [JavaScript Error: "'download' member of DownloadEventInit does not
> implement interface DOMDownload." {file: "jar:file:///system/b2g/omni.ja!/
> components/DownloadsAPI.js" line: 62}]
>
> Is there a trick to get the js object to be seen as implementing
> DOMDownload?
>
>         Fabrice
> _______________________________________________
> dev-platform mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-platform
>
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to