KT-2752: minor fixes after code review

This commit is contained in:
Alexey Andreev
2016-08-23 15:32:39 +03:00
parent 7956b038fd
commit aa5d15cff7
13 changed files with 36 additions and 86 deletions
-13
View File
@@ -1,13 +0,0 @@
var bar = function() { return 23; };
var baz = 123;
function B() {
this.q = 32;
}
B.prototype.g = function() { return 42; };
B.q = 132;
B.g = function() { return 142; };
var P = {
f: function() { return 222; }
};
-36
View File
@@ -1,36 +0,0 @@
package foo
@JsName("bar") @native fun foo(): Int = noImpl
@JsName("baz") @native val prop: Int get() = noImpl
@JsName("B") @native class A {
@JsName("g") fun f(): Int = noImpl
@JsName("q") val p: Int get() = noImpl
companion object {
@JsName("g") fun f(): Int = noImpl
@JsName("q") val p: Int get() = noImpl
}
}
@JsName("P") @native object O {
fun f(): Int = noImpl
}
fun box(): String {
assertEquals(23, foo())
assertEquals(123, prop)
assertEquals(42, A().f())
assertEquals(32, A().p)
assertEquals(142, A.f())
assertEquals(132, A.p)
assertEquals(222, O.f())
return "OK"
}
@@ -1,20 +0,0 @@
function A() {
this.y_ = 0;
}
A.prototype.getX = function() {
return 23;
};
A.prototype.getY = function() {
return this.y_;
};
A.prototype.setY = function(y) {
return this.y_ = y;
};
var z_ = 32;
function getZ() {
return z_;
}
function setZ(z) {
z_ = z;
}
@@ -1,29 +0,0 @@
package foo
@native class A {
val xx: Int
@JsName("getX") get
var yy: Int
@JsName("getY") get
@JsName("setY") set
}
@native var zz: Int
@JsName("getZ") get
@JsName("setZ") set
fun box(): String {
val a = A()
assertEquals(23, a.xx)
assertEquals(0, a.yy)
a.yy = 42
assertEquals(42, a.yy)
assertEquals(32, zz)
zz = 232
assertEquals(232, zz)
return "OK"
}