Re: [Json] Call for real-world examples of how parsers deal with duplicate keys

Allen Wirfs-Brock <allen@wirfs-brock.com> Thu, 06 June 2013 19:51 UTC

Return-Path: <allen@wirfs-brock.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5E35811E80F2 for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 12:51:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.25
X-Spam-Level:
X-Spam-Status: No, score=-2.25 tagged_above=-999 required=5 tests=[AWL=0.426, BAYES_00=-2.599, HELO_MISMATCH_ORG=0.611, HOST_MISMATCH_COM=0.311, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5fg70Qaw+YBW for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 12:51:46 -0700 (PDT)
Received: from smtp.mozilla.org (mx2.corp.phx1.mozilla.com [63.245.216.70]) by ietfa.amsl.com (Postfix) with ESMTP id 8AAE321E80B0 for <json@ietf.org>; Thu, 6 Jun 2013 12:51:46 -0700 (PDT)
Received: from [192.168.0.15] (069-064-236-244.pdx.net [69.64.236.244]) (Authenticated sender: allenwb@mozilla.com) by mx2.mail.corp.phx1.mozilla.com (Postfix) with ESMTPSA id BE67DF217C; Thu, 6 Jun 2013 12:51:45 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1085)
Content-Type: multipart/alternative; boundary="Apple-Mail-44--748406316"
From: Allen Wirfs-Brock <allen@wirfs-brock.com>
In-Reply-To: <BF7E36B9C495A6468E8EC573603ED9411527E77E@xmb-aln-x11.cisco.com>
Date: Thu, 06 Jun 2013 12:51:41 -0700
Message-Id: <D7B58C56-32FB-4A68-8D27-A6B89F701BAC@wirfs-brock.com>
References: <C79C116D-16A4-41BA-9E5A-1055E6B9C941@vpnc.org> <BF7E36B9C495A6468E8EC573603ED9411527E77E@xmb-aln-x11.cisco.com>
To: Matt Miller <mamille2@cisco.com>
X-Mailer: Apple Mail (2.1085)
Cc: Paul Hoffman <paul.hoffman@vpnc.org>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Call for real-world examples of how parsers deal with duplicate keys
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 07 Jun 2013 16:36:59 -0000

On Jun 6, 2013, at 11:05 AM, Matt Miller (mamille2) wrote:

> On Jun 6, 2013, at 11:41 AM, Paul Hoffman <paul.hoffman@vpnc.org>
> wrote:
> 
> 
> 
> Experiments should always have a control!  I think we can consider this the control:
> 
> -----BEGIN JAVASCRIPT-----
> var input = '{"a":1,"a":2}';
> 
> var output;
> output = JSON.parse(input);
> output = JSON.stringify(output);
> 
> console.log(output);
> -----END JAVASCRIPT-----
> 
> # node.js 0.10.8
> {"a":2}
> 
> # Firefox 22
> {"a":2}
> 
> # Safari 6.5
> {"a":2}
> 
> # Chrome 27
> {"a":2}
> 

The ECMAScript standard requires the behavior shown above.

Allen