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