NASHORN-620.js revision 877:cf4d2252d444
1248590Smm/* 2248590Smm * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 3248590Smm * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4248590Smm * 5248590Smm * This code is free software; you can redistribute it and/or modify it 6248590Smm * under the terms of the GNU General Public License version 2 only, as 7248590Smm * published by the Free Software Foundation. 8248590Smm * 9248590Smm * This code is distributed in the hope that it will be useful, but WITHOUT 10248590Smm * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11248590Smm * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12248590Smm * version 2 for more details (a copy is included in the LICENSE file that 13248590Smm * accompanied this code). 14248590Smm * 15248590Smm * You should have received a copy of the GNU General Public License version 16248590Smm * 2 along with this work; if not, write to the Free Software Foundation, 17248590Smm * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18248590Smm * 19248590Smm * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20248590Smm * or visit www.oracle.com if you need additional information or have any 21248590Smm * questions. 22248590Smm */ 23248590Smm 24248590Smm/* 25248590Smm * NASHORN-620: Trailing comma at the end of an array literal should be ignored. 26248590Smm * 27248590Smm * @test 28248590Smm * @run 29248590Smm */ 30248590Smm 31248590Smmprint([].length); 32248590Smmprint([,].length); 33248590Smmprint([,,].length); 34248590Smmprint([,4,].length); 35248590Smmprint([1,,3,].length); 36248590Smm