JDK-8015357.js revision 337:1a5d67424e83
180708Sjake/*
280708Sjake * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
382902Sjake * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
482902Sjake *
580708Sjake * This code is free software; you can redistribute it and/or modify it
680708Sjake * under the terms of the GNU General Public License version 2 only, as
782902Sjake * published by the Free Software Foundation.
882902Sjake *
982902Sjake * This code is distributed in the hope that it will be useful, but WITHOUT
1080708Sjake * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1180708Sjake * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1280708Sjake * version 2 for more details (a copy is included in the LICENSE file that
1380708Sjake * accompanied this code).
1480708Sjake *
1580708Sjake * You should have received a copy of the GNU General Public License version
1680708Sjake * 2 along with this work; if not, write to the Free Software Foundation,
1780708Sjake * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1882902Sjake *
1982902Sjake * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2082902Sjake * or visit www.oracle.com if you need additional information or have any
2180708Sjake * questions.
2282902Sjake */
2380708Sjake
2480708Sjake/**
2582902Sjake * JDK-8015357: a = []; a[0x7fffffff]=1; a.sort()[0] should evaluate to 1 instead of undefined
2680708Sjake *
2780708Sjake * @test
2880708Sjake * @run
2980708Sjake */
3080708Sjake
3180708Sjakevar a = [];
3280708Sjakea[0x7fffffff]=1;
3380708Sjake
3482902Sjakeif (a.sort()[0] != 1) {
35181701Smarius    fail("a.sort()[0] != 1");
3680708Sjake}
3780708Sjake
38145151Smarius