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

Re: [json] Re: Non-unique keys in JSON objects

Expand Messages
  • Matěj Cepl
    ... Brownie points for the discovery should go to my colleague Richard Opálka (ropalka at the same domain my email comes from). Just to make this clear.
    Message 1 of 6 , Sep 5, 2012
    • 0 Attachment
      On 05/09/12 18:16, douglascrockford wrote:
      >> And that makes me really puzzled. SHOULD???
      >
      > It should have been MUST. I said SHOULD because I wanted JavaScript's
      > eval function to conform. At the time, I thought that was a necessary
      > transitional device. Fortunately, it appears that all other
      > implementations, including ES5's JSON.parse, assumed MUST.

      Brownie points for the discovery should go to my colleague Richard
      Opálka (ropalka at the same domain my email comes from).

      Just to make this clear.

      Matěj

      --
      http://www.ceplovi.cz/matej/, Jabber: mcepl<at>ceplovi.cz
      GPG Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC

      I didn't attend the funeral, but I sent a nice letter saying
      I approved of it.
      -- Mark Twain
    • douglascrockford
      ... You can do as you like, but I think it would be better if you throw the exception.
      Message 2 of 6 , Sep 5, 2012
      • 0 Attachment
        --- In json@yahoogroups.com, Jonathan Wallace <ninja9578@...> wrote:

        > Libjson will parse them all, if you attempt to get the object by its key and said key is not unique, it will give you the first one. The only way to get the second would be to use an integrator and check the keys one by one. I've had a few requests to throw exceptions in the case of multiple objects with the same key, but it would break the standard.


        You can do as you like, but I think it would be better if you throw the exception.
      • Jonathan Wallace
        I will likely make it a compilation error in the next release Sent from my iPhone ... [Non-text portions of this message have been removed]
        Message 3 of 6 , Sep 6, 2012
        • 0 Attachment
          I will likely make it a compilation error in the next release

          Sent from my iPhone

          On Sep 5, 2012, at 12:28, "douglascrockford" <douglas@...> wrote:

          > --- In json@yahoogroups.com, Jonathan Wallace <ninja9578@...> wrote:
          >
          > > Libjson will parse them all, if you attempt to get the object by its key and said key is not unique, it will give you the first one. The only way to get the second would be to use an integrator and check the keys one by one. I've had a few requests to throw exceptions in the case of multiple objects with the same key, but it would break the standard.
          >
          > You can do as you like, but I think it would be better if you throw the exception.
          >
          >
          >
          >
          >
          >
          >

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