attila@1983: /* attila@1983: * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. attila@1983: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. attila@1983: * attila@1983: * This code is free software; you can redistribute it and/or modify it attila@1983: * under the terms of the GNU General Public License version 2 only, as attila@1983: * published by the Free Software Foundation. attila@1983: * attila@1983: * This code is distributed in the hope that it will be useful, but WITHOUT attila@1983: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or attila@1983: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License attila@1983: * version 2 for more details (a copy is included in the LICENSE file that attila@1983: * accompanied this code). attila@1983: * attila@1983: * You should have received a copy of the GNU General Public License version attila@1983: * 2 along with this work; if not, write to the Free Software Foundation, attila@1983: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. attila@1983: * attila@1983: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA attila@1983: * or visit www.oracle.com if you need additional information or have any attila@1983: * questions. attila@1983: */ attila@1983: attila@1983: /** attila@1983: * JDK-8171849: Collection and Queue conversions not prioritized for Arrays attila@1983: * attila@1983: * @test attila@1983: * @run attila@1983: */ attila@1983: attila@1983: var acp = new (Java.type("jdk.nashorn.test.models.ArrayConversionPreferences")) attila@1983: attila@1983: var a = [1, "", {}] attila@1983: attila@1983: Assert.assertTrue(acp.testCollectionOverMap(a)) attila@1983: Assert.assertTrue(acp.testCollectionOverArray(a)) attila@1983: Assert.assertTrue(acp.testListOverMap(a)) attila@1983: Assert.assertTrue(acp.testListOverArray(a)) attila@1983: Assert.assertTrue(acp.testListOverCollection(a)) attila@1983: Assert.assertTrue(acp.testQueueOverMap(a)) attila@1983: Assert.assertTrue(acp.testQueueOverArray(a)) attila@1983: Assert.assertTrue(acp.testQueueOverCollection(a)) attila@1983: Assert.assertTrue(acp.testDequeOverMap(a)) attila@1983: Assert.assertTrue(acp.testDequeOverArray(a)) attila@1983: Assert.assertTrue(acp.testDequeOverCollection(a)) attila@1983: Assert.assertTrue(acp.testDequeOverQueue(a)) attila@1983: Assert.assertTrue(acp.testArrayOverMap(a))