Closed Bug 322597 Opened 19 years ago Closed 13 years ago

using AString as outparam doesn't work when using it from javascript

Categories

(Core :: XPConnect, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 535685

People

(Reporter: mvl, Unassigned)

Details

Attachments

(3 files)

In an .idl file, i tried to use an AString as outparam. I couldn't get it to work. It threw an NS_ERROR_FAILURE. Both the component implementation and the caller were written in javascript. When using wstring instead, it worked just like it should.

steps to reproduce:
1. write an idl with |void testOutAString(out AUTF8String aStr);|
2. implement the component in javascript:
    function f(aStr){aStr.value="foo"; return}
3. call it: o={}; test.testOutAString(o);

result: error thrown.
Attached file testcase: the idl
You need to somehow xpidl this file. I've done that by putting it in mozilla/calendar/base/public, and added it to the makefile
this is the implementation. Just put it in the components dir.
finally, the caller. Just run from xpcshell. It shouldn't throw an error, but it does.
Comment on attachment 207751 [details]
testcase: the idl

>  void testOutAString(out AUTF8String aStr);

That should have been AString, not AUTF8String. But it doesn't really matter, because the problem stays.
Assignee: dbradley → nobody
QA Contact: pschwartau → xpconnect
Fixed by bug 535685 (a one line change) in revision 420131e7219d.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: