JS: remove Kotlin.createClass/definePackage/etc functions from stdlib. Reimplement some classes in Kotlin
This commit is contained in:
+10
-12
@@ -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
@@ -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("##")
|
||||
|
||||
Reference in New Issue
Block a user