Tue, 16 Aug 2016 21:41:28 -0700
Added tag jdk8u102-b33 for changeset 36e3c21b5fca
hannesw@59 | 1 | /* |
hannesw@59 | 2 | * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
hannesw@59 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
hannesw@59 | 4 | * |
hannesw@59 | 5 | * This code is free software; you can redistribute it and/or modify it |
hannesw@59 | 6 | * under the terms of the GNU General Public License version 2 only, as |
hannesw@59 | 7 | * published by the Free Software Foundation. |
hannesw@59 | 8 | * |
hannesw@59 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
hannesw@59 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
hannesw@59 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
hannesw@59 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
hannesw@59 | 13 | * accompanied this code). |
hannesw@59 | 14 | * |
hannesw@59 | 15 | * You should have received a copy of the GNU General Public License version |
hannesw@59 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
hannesw@59 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
hannesw@59 | 18 | * |
hannesw@59 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
hannesw@59 | 20 | * or visit www.oracle.com if you need additional information or have any |
hannesw@59 | 21 | * questions. |
hannesw@59 | 22 | */ |
hannesw@59 | 23 | |
hannesw@59 | 24 | /** |
hannesw@59 | 25 | * Conversion of ConsString to String |
hannesw@59 | 26 | * |
hannesw@59 | 27 | * @test |
hannesw@59 | 28 | * @run |
hannesw@59 | 29 | */ |
hannesw@59 | 30 | |
hannesw@59 | 31 | var list = new java.util.ArrayList(); |
hannesw@59 | 32 | var str = "foo"; |
hannesw@59 | 33 | |
hannesw@59 | 34 | list.add(str); // plain string |
hannesw@59 | 35 | list.add(String(str + "1")); // String() called as function |
hannesw@59 | 36 | list.add(String(new String(str + "2"))); // String() called as function with String object |
hannesw@59 | 37 | list.add((str + "3").toString()); // toString() called on primitive string |
hannesw@59 | 38 | list.add(new String(str + "4").toString()); // toString() called on String object |
hannesw@59 | 39 | |
sundar@136 | 40 | Packages.jdk.nashorn.test.models.StringArgs.checkString(list); |