lagergren@1083: /* lagergren@1083: * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. lagergren@1083: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. lagergren@1083: * lagergren@1083: * This code is free software; you can redistribute it and/or modify it lagergren@1083: * under the terms of the GNU General Public License version 2 only, as lagergren@1083: * published by the Free Software Foundation. lagergren@1083: * lagergren@1083: * This code is distributed in the hope that it will be useful, but WITHOUT lagergren@1083: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or lagergren@1083: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License lagergren@1083: * version 2 for more details (a copy is included in the LICENSE file that lagergren@1083: * accompanied this code). lagergren@1083: * lagergren@1083: * You should have received a copy of the GNU General Public License version lagergren@1083: * 2 along with this work; if not, write to the Free Software Foundation, lagergren@1083: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. lagergren@1083: * lagergren@1083: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA lagergren@1083: * or visit www.oracle.com if you need additional information or have any lagergren@1083: * questions. lagergren@1083: */ lagergren@1083: lagergren@1083: /** lagergren@1083: * JDK-8062381 wrong argument chosen for charCodeAt in linker logic lagergren@1083: * lagergren@1083: * @test lagergren@1083: * @run lagergren@1083: */ lagergren@1083: lagergren@1083: var s = "abcdef"; lagergren@1083: var len = s.length + 1; lagergren@1083: lagergren@1083: function f1() { lagergren@1083: for (var i = 0; i < len; i++) { lagergren@1083: print(s.charCodeAt(i)); lagergren@1083: } lagergren@1083: print(s.charCodeAt()); lagergren@1083: } lagergren@1083: lagergren@1083: function f2() { lagergren@1083: for (var i = 0; i < len; i++) { lagergren@1083: print(s.charCodeAt("" + i)); lagergren@1083: } lagergren@1083: print(s.charCodeAt()); lagergren@1083: } lagergren@1083: lagergren@1083: f1(); lagergren@1083: f2(); lagergren@1083: f1(); lagergren@1083: f2(); lagergren@1083: lagergren@1083: