test/script/basic/JDK-8061391_3.js

Wed, 03 Jun 2015 18:08:57 +0200

author
hannesw
date
Wed, 03 Jun 2015 18:08:57 +0200
changeset 1396
d5a9705a27b1
parent 1071
78eb2b415108
permissions
-rw-r--r--

8066237: Fuzzing bug: Parser error on optimistic recompilation
Reviewed-by: lagergren, attila

lagergren@1071 1 /*
lagergren@1071 2 * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
lagergren@1071 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
lagergren@1071 4 *
lagergren@1071 5 * This code is free software; you can redistribute it and/or modify it
lagergren@1071 6 * under the terms of the GNU General Public License version 2 only, as
lagergren@1071 7 * published by the Free Software Foundation.
lagergren@1071 8 *
lagergren@1071 9 * This code is distributed in the hope that it will be useful, but WITHOUT
lagergren@1071 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
lagergren@1071 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
lagergren@1071 12 * version 2 for more details (a copy is included in the LICENSE file that
lagergren@1071 13 * accompanied this code).
lagergren@1071 14 *
lagergren@1071 15 * You should have received a copy of the GNU General Public License version
lagergren@1071 16 * 2 along with this work; if not, write to the Free Software Foundation,
lagergren@1071 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
lagergren@1071 18 *
lagergren@1071 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
lagergren@1071 20 * or visit www.oracle.com if you need additional information or have any
lagergren@1071 21 * questions.
lagergren@1071 22 */
lagergren@1071 23
lagergren@1071 24 /**
lagergren@1071 25 * Array extension check
lagergren@1071 26 *
lagergren@1071 27 * @test
lagergren@1071 28 * @run
lagergren@1071 29 */
lagergren@1071 30
lagergren@1071 31 var a = [1,2,3];
lagergren@1071 32 Object.preventExtensions(a);
lagergren@1071 33 a[4] = 4;
lagergren@1071 34 print(a);
lagergren@1071 35 if (a[0] != 1) {
lagergren@1071 36 throw "element 0 is wrong";
lagergren@1071 37 }
lagergren@1071 38 if (a[1] != 2) {
lagergren@1071 39 throw "element 1 is wrong";
lagergren@1071 40 }
lagergren@1071 41 if (a[2] != 3) {
lagergren@1071 42 throw "element 2 is wrong";
lagergren@1071 43 }
lagergren@1071 44

mercurial