[jose] .NET JavaScriptSerializer wrt ES6

Anders Rundgren <anders.rundgren.net@gmail.com> Fri, 30 October 2015 14:15 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E45031A1A97 for <jose@ietfa.amsl.com>; Fri, 30 Oct 2015 07:15:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.166
X-Spam-Level:
X-Spam-Status: No, score=0.166 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FF_IHOPE_YOU_SINK=2.166, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FsTaVsTp6Xcf for <jose@ietfa.amsl.com>; Fri, 30 Oct 2015 07:15:08 -0700 (PDT)
Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E18BE1A1A8A for <jose@ietf.org>; Fri, 30 Oct 2015 07:15:07 -0700 (PDT)
Received: by wijp11 with SMTP id p11so12020772wij.0 for <jose@ietf.org>; Fri, 30 Oct 2015 07:15:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=MzwWZf3PJbC7gjUH04cV/fxqpv0+cdBgxDPwPXJ7AmQ=; b=GloIZFuafQDLN9QQWqERjD06g+84SYgW1PJBIpYFP0QYgNO+flJy0wwGXd42+uh48e Q9rLKHuRfMueG0aUG5C/65pJbKcKRnWrARoehRfd0Pd/oS9EoXgMCttir4Q9JCaKVjzF uN0BaIcgx4xMgypMOlrO0nKuiXAyfPKWrvhpcrlTx7ZxaPZJti7Uy1PCqucwUXQJgWFq fXkYS8zvF7LdTWpW43yW8mH8Oof9ZQTyJwcQAWyVN4CYYLofGNCVzm9b0pAyabPcgFZ9 slF5QOBXxIyJ7JyWrMoT39ZySQcZQLl0X4t/+r/9h12SqCYX7Dna1IaybUyEjCYN6rN1 5DXA==
X-Received: by 10.194.189.68 with SMTP id gg4mr8422060wjc.146.1446214506522; Fri, 30 Oct 2015 07:15:06 -0700 (PDT)
Received: from [192.168.1.79] (148.198.130.77.rev.sfr.net. [77.130.198.148]) by smtp.googlemail.com with ESMTPSA id b12sm3117885wma.6.2015.10.30.07.15.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Oct 2015 07:15:05 -0700 (PDT)
From: Anders Rundgren <anders.rundgren.net@gmail.com>
To: "jose@ietf.org" <jose@ietf.org>, Michael Jones <michael.jones@microsoft.com>
Message-ID: <56337B62.8010008@gmail.com>
Date: Fri, 30 Oct 2015 15:14:58 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/jose/Zsn4UMEkovrzgdjYC1HLoxPWW60>
Subject: [jose] .NET JavaScriptSerializer wrt ES6
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 30 Oct 2015 14:15:14 -0000

Hi Mike,
This shows what we actually agree on, non-ES6 systems aren't likely to work with what I'm proposing (well, building) without an upgrade:

C#:
         document["quoting"] = "'hi!'";
         document["floating"] = 0.00005;

After running the JavaScriptSerializer using v4.5 of .NET I got

      {"quoting":"\u0027hi!\u0027","floating":5E-05}

which is technically correct but differs from browsers which always normalize strings and format numbers as specified by ES6:

      {"quoting":"'hi!'","floating":0.00005}

OTOH, a patch, QA, test-suites, and all should be a fairly small task.

http://webpki.org/ietf/es6numberbrowsertest.html
Apparently the edge-case IEEE underflow is a remaining issue in my number converter but I'm not able to tell who's wrong.

Best,
Anders