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