sundar@1651: /* sundar@1651: * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. sundar@1651: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. sundar@1651: * sundar@1651: * This code is free software; you can redistribute it and/or modify it sundar@1651: * under the terms of the GNU General Public License version 2 only, as sundar@1651: * published by the Free Software Foundation. sundar@1651: * sundar@1651: * This code is distributed in the hope that it will be useful, but WITHOUT sundar@1651: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or sundar@1651: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License sundar@1651: * version 2 for more details (a copy is included in the LICENSE file that sundar@1651: * accompanied this code). sundar@1651: * sundar@1651: * You should have received a copy of the GNU General Public License version sundar@1651: * 2 along with this work; if not, write to the Free Software Foundation, sundar@1651: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. sundar@1651: * sundar@1651: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA sundar@1651: * or visit www.oracle.com if you need additional information or have any sundar@1651: * questions. sundar@1651: */ sundar@1651: sundar@1651: /** sundar@1651: * JDK-8146147: Java linker indexed property getter does not work for computed nashorn string sundar@1651: * sundar@1651: * @test sundar@1651: * @run sundar@1651: */ sundar@1651: sundar@1651: var locale = java.util.Locale.ENGLISH; sundar@1651: var prop = 'ISO3Language'; sundar@1651: var prop1 = 'ISO3'; sundar@1651: var prop2 = prop1 + 'Language'; sundar@1651: var prop3 = String(prop2); sundar@1651: sundar@1651: function checkLang(obj) { sundar@1651: if (obj != "eng") { sundar@1651: throw new Error("FAILED: expected 'eng', got " + obj); sundar@1651: } sundar@1651: } sundar@1651: sundar@1651: checkLang(locale.ISO3Language); sundar@1651: checkLang(locale['ISO3Language']); sundar@1651: checkLang(locale[prop]); sundar@1651: checkLang(locale[prop1 + 'Language']); sundar@1651: checkLang(locale[prop2]); sundar@1651: checkLang(locale[prop3]); sundar@1651: checkLang(locale[String(prop1 + 'Language')]);