JS: remove Kotlin.createClass/definePackage/etc functions from stdlib. Reimplement some classes in Kotlin

This commit is contained in:
Alexey Andreev
2016-11-18 19:53:14 +03:00
parent 3eea735b4a
commit 8b9852edec
7 changed files with 135 additions and 505 deletions
+10 -12
View File
@@ -1,18 +1,16 @@
(function () {
var c = 0;
kotlin.A = kotlin.createClassNow(null,
function () {
this.f = function (i) {
if (i === undefined && c === 0) {
c = 1;
}
if (i === 2 && c === 1) {
c = 2;
}
}
}
);
kotlin.A = function() {
this.f = function (i) {
if (i === undefined && c === 0) {
c = 1;
}
if (i === 2 && c === 1) {
c = 2;
}
}
};
kotlin.getResult = function () {
return c === 2;
};
+7 -3
View File
@@ -2,7 +2,9 @@
package foo
val EXPECTED = """Hello, World
^^
^^
^^
***
####
"""
@@ -10,7 +12,9 @@ val EXPECTED = """Hello, World
val EXPECTED_NEWLINE_FOR_EACH = """Hello
, World
^^
^^
^^
***
##
@@ -28,7 +32,7 @@ fun test(expected: String, initCode: String, getResult: () -> String) {
print("Hello")
print(", World")
print("\n")
print("\n^^\n^^\n^^")
println()
println("***")
print("##")