JDK-8068872.js revision 1179:2b9af466a49d
186221Stmm/*
286221Stmm * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
386221Stmm * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
486221Stmm *
586221Stmm * This code is free software; you can redistribute it and/or modify it
686221Stmm * under the terms of the GNU General Public License version 2 only, as
786221Stmm * published by the Free Software Foundation.
886221Stmm *
986221Stmm * This code is distributed in the hope that it will be useful, but WITHOUT
1086221Stmm * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1186221Stmm * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1286221Stmm * version 2 for more details (a copy is included in the LICENSE file that
1386221Stmm * accompanied this code).
1486221Stmm *
1586221Stmm * You should have received a copy of the GNU General Public License version
1686221Stmm * 2 along with this work; if not, write to the Free Software Foundation,
1786221Stmm * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1886221Stmm *
1986221Stmm * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2086221Stmm * or visit www.oracle.com if you need additional information or have any
2186221Stmm * questions.
2286221Stmm */
2386221Stmm
2486221Stmm/**
2586221Stmm * JDK-8068872:  Nashorn JSON.parse drops numeric keys
2686221Stmm *
2786221Stmm * @test
2886221Stmm * @run
2986221Stmm */
3086221Stmm
3186221Stmmprint(JSON.stringify(JSON.parse('{"3": 1, "5": "a"}')));
3286221Stmmprint(JSON.stringify(JSON.parse('{"5": 1, "3": "a"}')));
3386221Stmmprint(JSON.stringify(JSON.parse('{"0": 1, "4294967294": "a"}')));
3486221Stmmprint(JSON.stringify(JSON.parse('{"4294967294": 1, "0": "a"}')));
3586221Stmm