sundar@1550: /* sundar@1550: * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. sundar@1550: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. sundar@1550: * sundar@1550: * This code is free software; you can redistribute it and/or modify it sundar@1550: * under the terms of the GNU General Public License version 2 only, as sundar@1550: * published by the Free Software Foundation. sundar@1550: * sundar@1550: * This code is distributed in the hope that it will be useful, but WITHOUT sundar@1550: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or sundar@1550: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License sundar@1550: * version 2 for more details (a copy is included in the LICENSE file that sundar@1550: * accompanied this code). sundar@1550: * sundar@1550: * You should have received a copy of the GNU General Public License version sundar@1550: * 2 along with this work; if not, write to the Free Software Foundation, sundar@1550: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. sundar@1550: * sundar@1550: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA sundar@1550: * or visit www.oracle.com if you need additional information or have any sundar@1550: * questions. sundar@1550: */ sundar@1550: sundar@1550: /** sundar@1550: * JDK-8137134: invokespecial on indirect super interface is generated by Java adapter generator sundar@1550: * sundar@1550: * @test sundar@1550: * @run sundar@1550: */ sundar@1550: sundar@1550: var B = Java.type("jdk.nashorn.test.models.B"); sundar@1550: var b1 = new B() {} sundar@1550: print(b1.a()); sundar@1550: print(b1.b()); sundar@1550: sundar@1550: var b2 = new B() { sundar@1550: b: function() { sundar@1550: return "from B.b in script"; sundar@1550: } sundar@1550: }; sundar@1550: sundar@1550: print(b2.a()); sundar@1550: print(b2.b()); sundar@1550: sundar@1550: var b3 = new B() { sundar@1550: a: function() { sundar@1550: return "from A.a in script"; sundar@1550: }, sundar@1550: b: function() { sundar@1550: return "from B.b in script"; sundar@1550: } sundar@1550: }; sundar@1550: sundar@1550: print(b3.a()); sundar@1550: print(b3.b());