mhaupt@1739: /* mhaupt@1739: * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. mhaupt@1739: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. mhaupt@1739: * mhaupt@1739: * This code is free software; you can redistribute it and/or modify it mhaupt@1739: * under the terms of the GNU General Public License version 2 only, as mhaupt@1739: * published by the Free Software Foundation. mhaupt@1739: * mhaupt@1739: * This code is distributed in the hope that it will be useful, but WITHOUT mhaupt@1739: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or mhaupt@1739: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License mhaupt@1739: * version 2 for more details (a copy is included in the LICENSE file that mhaupt@1739: * accompanied this code). mhaupt@1739: * mhaupt@1739: * You should have received a copy of the GNU General Public License version mhaupt@1739: * 2 along with this work; if not, write to the Free Software Foundation, mhaupt@1739: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. mhaupt@1739: * mhaupt@1739: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA mhaupt@1739: * or visit www.oracle.com if you need additional information or have any mhaupt@1739: * questions. mhaupt@1739: */ mhaupt@1739: mhaupt@1739: /** mhaupt@1739: * JDK-8149334: JSON.parse(JSON.stringify([])).push(10) creates an array containing two elements mhaupt@1739: * mhaupt@1739: * @test mhaupt@1739: * @run mhaupt@1739: */ mhaupt@1739: mhaupt@1739: var a = JSON.parse(JSON.stringify([])) mhaupt@1739: print(a.length) mhaupt@1739: a.push(10) mhaupt@1739: print(a.length) mhaupt@1739: print(a) mhaupt@1739: mhaupt@1739: var b = JSON.parse(JSON.stringify([])) mhaupt@1739: print(b.length) mhaupt@1739: b.push('ieps') mhaupt@1739: print(b.length) mhaupt@1739: print(b)