test/script/basic/JDK-8137134.js

Tue, 21 Mar 2017 13:41:57 -0700

author
asaha
date
Tue, 21 Mar 2017 13:41:57 -0700
changeset 2160
1df40fe54cd6
parent 1550
e9ea7010825b
permissions
-rw-r--r--

Merge

sundar@1550 1 /*
sundar@1550 2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
sundar@1550 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
sundar@1550 4 *
sundar@1550 5 * This code is free software; you can redistribute it and/or modify it
sundar@1550 6 * under the terms of the GNU General Public License version 2 only, as
sundar@1550 7 * published by the Free Software Foundation.
sundar@1550 8 *
sundar@1550 9 * This code is distributed in the hope that it will be useful, but WITHOUT
sundar@1550 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
sundar@1550 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
sundar@1550 12 * version 2 for more details (a copy is included in the LICENSE file that
sundar@1550 13 * accompanied this code).
sundar@1550 14 *
sundar@1550 15 * You should have received a copy of the GNU General Public License version
sundar@1550 16 * 2 along with this work; if not, write to the Free Software Foundation,
sundar@1550 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
sundar@1550 18 *
sundar@1550 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
sundar@1550 20 * or visit www.oracle.com if you need additional information or have any
sundar@1550 21 * questions.
sundar@1550 22 */
sundar@1550 23
sundar@1550 24 /**
sundar@1550 25 * JDK-8137134: invokespecial on indirect super interface is generated by Java adapter generator
sundar@1550 26 *
sundar@1550 27 * @test
sundar@1550 28 * @run
sundar@1550 29 */
sundar@1550 30
sundar@1550 31 var B = Java.type("jdk.nashorn.test.models.B");
sundar@1550 32 var b1 = new B() {}
sundar@1550 33 print(b1.a());
sundar@1550 34 print(b1.b());
sundar@1550 35
sundar@1550 36 var b2 = new B() {
sundar@1550 37 b: function() {
sundar@1550 38 return "from B.b in script";
sundar@1550 39 }
sundar@1550 40 };
sundar@1550 41
sundar@1550 42 print(b2.a());
sundar@1550 43 print(b2.b());
sundar@1550 44
sundar@1550 45 var b3 = new B() {
sundar@1550 46 a: function() {
sundar@1550 47 return "from A.a in script";
sundar@1550 48 },
sundar@1550 49 b: function() {
sundar@1550 50 return "from B.b in script";
sundar@1550 51 }
sundar@1550 52 };
sundar@1550 53
sundar@1550 54 print(b3.a());
sundar@1550 55 print(b3.b());

mercurial