[JS IR BE] Add @JsName to inheritanceInNativeClass.kt test to avoid relying on mangling

This commit is contained in:
Svyatoslav Kuzmich
2019-02-28 21:26:38 +03:00
parent 9230b70294
commit c7f1238a07
2 changed files with 9 additions and 7 deletions
@@ -1,8 +1,8 @@
function createA() {
function ADerived() {
}
ADerived.prototype = Object.create(JS_TESTS.foo.A.prototype);
ADerived.prototype.foo_za3lpa$ = function(n) {
ADerived.prototype = Object.create(JS_TESTS.A.prototype);
ADerived.prototype.foo = function(n) {
return 24;
};
return new ADerived();
@@ -11,9 +11,9 @@ function createA() {
function createB() {
function BDerived() {
}
BDerived.prototype = Object.create(JS_TESTS.foo.B.prototype);
BDerived.prototype.bar_za3lpa$ = function(n) {
return this.foo_za3lpa$(n);
BDerived.prototype = Object.create(JS_TESTS.B.prototype);
BDerived.prototype.bar = function(n) {
return this.foo(n);
};
return new BDerived();
}
@@ -1,17 +1,19 @@
// IGNORE_BACKEND: JS_IR
// SKIP_MINIFICATION
// Contains calls from external JS code
package foo
open class A {
@JsName("foo")
open protected fun foo(n: Int) = 23
@JsName("bar")
fun bar(n: Int) = foo(n) + 100
}
open class B {
@JsName("foo")
protected fun foo(n: Int) = 42
@JsName("bar")
open fun bar(n: Int) = 142
}