Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

nativeJSON.decode is undefined in Nightly

18 views
Skip to first unread message

Jan Honza Odvarko

unread,
Jul 7, 2011, 5:07:01 AM7/7/11
to
var nativeJSON = Components.classes["@mozilla.org/dom/json;1"]
.createInstance(Components.interfaces.nsIJSON);
nativeJSON.decode;

returns: undefined

(Todays nightly 8.0a1, Built from http://hg.mozilla.org/mozilla-central/rev/58101c64c83c)

Is that a known problem?

Honza


smaug

unread,
Jul 7, 2011, 5:48:48 AM7/7/11
to Jan Honza Odvarko, jwald...@mit.edu

Jan Honza Odvarko

unread,
Jul 7, 2011, 6:44:25 AM7/7/11
to
On Jul 7, 11:48 am, smaug <sm...@welho.com> wrote:
> On 07/07/2011 12:07 PM, Jan Honza Odvarko wrote:> var nativeJSON = Components.classes["@mozilla.org/dom/json;1"]
> >                   .createInstance(Components.interfaces.nsIJSON);
> > nativeJSON.decode;
>
> > returns: undefined
>
> > (Todays nightly 8.0a1, Built fromhttp://hg.mozilla.org/mozilla-central/rev/58101c64c83c)

>
> > Is that a known problem?
>
> > Honza
>
> Seehttp://hg.mozilla.org/mozilla-central/rev/77a30f0f6a17
> andhttps://bugzilla.mozilla.org/show_bug.cgi?id=645922

Thanks!
Honza

Jeff Walden

unread,
Jul 7, 2011, 3:35:38 PM7/7/11
to
On 07/07/2011 03:44 AM, Jan Honza Odvarko wrote:
>> Seehttp://hg.mozilla.org/mozilla-central/rev/77a30f0f6a17
>> andhttps://bugzilla.mozilla.org/show_bug.cgi?id=645922

Yeah, nsIJSON.decode and nsIJSON.encode have been removed. They're basically equivalent to JSON.parse and JSON.stringify, and the nitpicky ways they differed made it necessary to grunge up the standard-JS implementation of that functionality. But why bother, if the pure-JS stuff did the same thing? So they're removed now, in TM and m-c.

Due to a misunderstanding the TM merge of the change missed the 7 train, but it looks like the process to address that means we did later merge it to aurora, so the two removals should happen in Firefox 7. I've poked addons people about scanning for it when determining addon compatibility and for addition to documentation lists and such. It should be simple for addon authors to make the switch if they need to do so.

Jeff

0 new messages