Closed Bug 295583 Opened 20 years ago Closed 20 years ago

TypeError: converter.AsyncConvertData is not a function

Categories

(Core :: Networking, defect)

defect
Not set
critical

Tracking

()

RESOLVED INVALID

People

(Reporter: f.parodi, Assigned: darin.moz)

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050523 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050523 Firefox/1.0+

TypeError: converter.AsyncConvertData is not a function

I'm getting this error in Deer Park. In FF 1.04 the function works fine.
Here's the code:

var converter =
Components.classes['@mozilla.org/streamconv;1?from=gzip&to=uncompressed'].createInstance(Components.interfaces.nsIStreamConverter);
var list = new dataListener(outFile, dest);
converter.AsyncConvertData("gzip", "uncompressed", list, null); 

Reproducible: Always
Assignee: dom-to-text → darin
Component: DOM to Text Conversion → Networking
QA Contact: benc
ok, two things:
1) to get an nsIStreamConverter, you should use the nsIStreamConverterService

2) AsyncConvertData was renamed to asyncConvertData. to find out which version
the current build is using, you can do:

if ("AsyncConvertData" in converter)
  converter.AsyncConvertData("gzip", "uncompressed", list, null); 
else
  converter.asyncConvertData("gzip", "uncompressed", list, null); 

However, if you use nsIStreamConverterService, you need not do that. the method
there didn't change its name.

This is not a bug.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
>However, if you use nsIStreamConverterService, you need not do that. the method
>there didn't change its name.

oops, sorry, that is not true. it also changed its name after 1.0.x branched,
although at a different point in time. so you still need code similar to what I
wrote above.
(In reply to comment #2)
ok, the renaming worked. Thank you very much!
You need to log in before you can comment on or make changes to this bug.