JDK-8027024.js revision 877:cf4d2252d444
1238106Sdes/* 2238106Sdes * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 3238106Sdes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4238106Sdes * 5238106Sdes * This code is free software; you can redistribute it and/or modify it 6238106Sdes * under the terms of the GNU General Public License version 2 only, as 7238106Sdes * published by the Free Software Foundation. 8238106Sdes * 9238106Sdes * This code is distributed in the hope that it will be useful, but WITHOUT 10238106Sdes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11238106Sdes * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12238106Sdes * version 2 for more details (a copy is included in the LICENSE file that 13238106Sdes * accompanied this code). 14238106Sdes * 15238106Sdes * You should have received a copy of the GNU General Public License version 16238106Sdes * 2 along with this work; if not, write to the Free Software Foundation, 17238106Sdes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18238106Sdes * 19238106Sdes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20238106Sdes * or visit www.oracle.com if you need additional information or have any 21238106Sdes * questions. 22238106Sdes */ 23238106Sdes 24269257Sdes/** 25269257Sdes * JDK-8027024: String.prototype.charAt and charCodeAt do not evaluate 'self' and 'pos' arguments in right order 26269257Sdes * 27269257Sdes * @test 28269257Sdes * @run 29269257Sdes */ 30269257Sdes 31269257Sdes 32269257SdesString.prototype.charAt.call( 33269257Sdes { 34238106Sdes toString: function() { 35238106Sdes print("charAt.self.toString"); 36238106Sdes } 37238106Sdes }, 38238106Sdes 39238106Sdes { 40238106Sdes valueOf: function() { 41238106Sdes print("charAt.pos.valueOf"); 42238106Sdes } 43238106Sdes } 44238106Sdes); 45238106Sdes 46238106SdesString.prototype.charCodeAt.call( 47238106Sdes { 48238106Sdes toString: function() { 49238106Sdes print("charCodeAt.self.toString"); 50238106Sdes } 51238106Sdes }, 52238106Sdes 53238106Sdes { 54238106Sdes valueOf: function() { 55238106Sdes print("charCodeAt.pos.valueOf"); 56238106Sdes } 57238106Sdes } 58238106Sdes); 59238106Sdes