test/script/basic/JDK-8068872.js

Tue, 21 Mar 2017 13:41:57 -0700

author
asaha
date
Tue, 21 Mar 2017 13:41:57 -0700
changeset 2160
1df40fe54cd6
parent 1229
f8da39d33117
permissions
-rw-r--r--

Merge

hannesw@1229 1 /*
hannesw@1229 2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
hannesw@1229 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
hannesw@1229 4 *
hannesw@1229 5 * This code is free software; you can redistribute it and/or modify it
hannesw@1229 6 * under the terms of the GNU General Public License version 2 only, as
hannesw@1229 7 * published by the Free Software Foundation.
hannesw@1229 8 *
hannesw@1229 9 * This code is distributed in the hope that it will be useful, but WITHOUT
hannesw@1229 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
hannesw@1229 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
hannesw@1229 12 * version 2 for more details (a copy is included in the LICENSE file that
hannesw@1229 13 * accompanied this code).
hannesw@1229 14 *
hannesw@1229 15 * You should have received a copy of the GNU General Public License version
hannesw@1229 16 * 2 along with this work; if not, write to the Free Software Foundation,
hannesw@1229 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
hannesw@1229 18 *
hannesw@1229 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
hannesw@1229 20 * or visit www.oracle.com if you need additional information or have any
hannesw@1229 21 * questions.
hannesw@1229 22 */
hannesw@1229 23
hannesw@1229 24 /**
hannesw@1229 25 * JDK-8068872: Nashorn JSON.parse drops numeric keys
hannesw@1229 26 *
hannesw@1229 27 * @test
hannesw@1229 28 * @run
hannesw@1229 29 */
hannesw@1229 30
hannesw@1229 31 print(JSON.stringify(JSON.parse('{"3": 1, "5": "a"}')));
hannesw@1229 32 print(JSON.stringify(JSON.parse('{"5": 1, "3": "a"}')));
hannesw@1229 33 print(JSON.stringify(JSON.parse('{"0": 1, "4294967294": "a"}')));
hannesw@1229 34 print(JSON.stringify(JSON.parse('{"4294967294": 1, "0": "a"}')));

mercurial