Loading ...
Sorry, an error occurred while loading the content.

Re: [json] Re: json2 and objects with toJSON function

Expand Messages
  • Erik Arvidsson
    toJSON is supposed to return the object to serialize. See step 2 in the abstract operation Str(key, holder) (page 204, section 15.12.3) in the spec. Your
    Message 1 of 7 , Feb 16, 2010
    • 0 Attachment
      toJSON is supposed to return the object to serialize. See step 2 in the
      abstract operation Str(key, holder) (page 204, section 15.12.3) in the spec.

      Your environment incorrectly returns a string for Array.prototype.toJSON
      which of course means you end up with a string in your serialized JSON.

      HTH,

      erik

      On Feb 16, 2010 4:32 AM, "soren.hilmer" <sh@...> wrote:





      Maybe.
      But I'm not looking for a workaround.
      I'm trying to push a bug fix towards json2.js

      This group seams to be the main communication entrypoint to
      http://www.json.org

      --Søren



      --- In json@yahoogroups.com, Andrea Giammarchi <andrea.giammarchi@...>
      wrote:
      >
      > Weird environmen...

      > On Mon, Feb 15, 2010 at 8:09 AM, soren.hilmer <sh@...> wrote:
      >
      > >
      > >
      > > Hi
      > >
      > > Just ran i...




      [Non-text portions of this message have been removed]
    • Erik Arvidsson
      ... spec = ECMA 262 edition 5, http://www.ecma-international.org/publications/standards/Ecma-262.htm ... -- erik [Non-text portions of this message have been
      Message 2 of 7 , Feb 16, 2010
      • 0 Attachment
        On Tue, Feb 16, 2010 at 09:14, Erik Arvidsson <erik.arvidsson@...>wrote:

        > toJSON is supposed to return the object to serialize. See step 2 in the
        > abstract operation Str(key, holder) (page 204, section 15.12.3) in the spec.
        >
        spec = ECMA 262 edition 5,
        http://www.ecma-international.org/publications/standards/Ecma-262.htm

        > Your environment incorrectly returns a string for Array.prototype.toJSON
        > which of course means you end up with a string in your serialized JSON.
        >
        > HTH,
        >
        > erik
        >
        > On Feb 16, 2010 4:32 AM, "soren.hilmer" <sh@...> wrote:
        >
        >
        >
        >
        >
        > Maybe.
        > But I'm not looking for a workaround.
        > I'm trying to push a bug fix towards json2.js
        >
        > This group seams to be the main communication entrypoint to
        > http://www.json.org
        >
        > --Søren
        >
        >
        >
        > --- In json@yahoogroups.com, Andrea Giammarchi <andrea.giammarchi@...>
        > wrote:
        > >
        > > Weird environmen...
        >
        > > On Mon, Feb 15, 2010 at 8:09 AM, soren.hilmer <sh@...> wrote:
        > >
        > > >
        > > >
        > > > Hi
        > > >
        > > > Just ran i...
        >
        >
        >
        >


        --
        erik


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.