JS: fix names in stdlib and tests WRT to new mangling algorithm

This commit is contained in:
Alexey Andreev
2017-01-18 19:52:15 +03:00
parent 2ae46ceb4b
commit 9aeba1d5cf
9 changed files with 17 additions and 18 deletions
+1 -1
View File
@@ -814,7 +814,7 @@ Kotlin.Long.prototype.equals = function (other) {
return other instanceof Kotlin.Long && this.equalsLong(other);
};
Kotlin.Long.prototype.compareTo_za3rmp$ = Kotlin.Long.prototype.compare;
Kotlin.Long.prototype.compareTo_11rb$ = Kotlin.Long.prototype.compare;
Kotlin.Long.prototype.inc = function() {
return this.add(Kotlin.Long.ONE);
+1 -1
View File
@@ -26,7 +26,7 @@ Kotlin.compareTo = function (a, b) {
if (typeA == "number" || typeA == "string") {
return a < b ? -1 : a > b ? 1 : 0;
}
return a.compareTo_za3rmp$(b);
return a.compareTo_11rb$(b);
};
Kotlin.primitiveCompareTo = function (a, b) {
@@ -57,7 +57,7 @@ fun test(expected: String, f: () -> Unit) {
val STABLE_EQUALS = "equals"
val STABLE_HASH_CODE = "hashCode"
val STABLE_TO_STRING = "toString"
val STABLE_EQUALS_2 = "equals_wn2jw4$"
val STABLE_EQUALS_2 = "equals_oaftn8$"
val STABLE_HASH_CODE_2 = "hashCode_za3lpa$"
val STABLE_TO_STRING_2 = "toString_61zpoe$"
@@ -6,10 +6,10 @@ package foo
// CHECK_CONTAINS_NO_CALLS: test4_buocd8$ except=imul
// CHECK_CONTAINS_NO_CALLS: test5 except=imul
// CHECK_HAS_INLINE_METADATA: apply
// CHECK_HAS_INLINE_METADATA: applyL_hiyix$
// CHECK_HAS_INLINE_METADATA: applyM_hiyix$
// CHECK_HAS_NO_INLINE_METADATA: applyN_hiyix$
// CHECK_HAS_NO_INLINE_METADATA: applyO_hiyix$
// CHECK_HAS_INLINE_METADATA: applyL_h43q6c$
// CHECK_HAS_INLINE_METADATA: applyM_h43q6c$
// CHECK_HAS_NO_INLINE_METADATA: applyN_h43q6c$
// CHECK_HAS_NO_INLINE_METADATA: applyO_h43q6c$
inline
public fun <T> apply(arg: T, func: (T)->T): T = func(arg)
+1 -1
View File
@@ -5,7 +5,7 @@
// CHECK_NOT_CALLED_IN_SCOPE: function=set_vux9f0$ scope=box
// CHECK_NOT_CALLED_IN_SCOPE: function=dec scope=box
// CHECK_NOT_CALLED_IN_SCOPE: function=minus_za3lpa$ scope=box
// CHECK_NOT_CALLED_IN_SCOPE: function=invoke_rksjo2$ scope=test
// CHECK_NOT_CALLED_IN_SCOPE: function=invoke_dqglrj$ scope=test
class A {
inline operator fun plus(a: Int) = a + 10
@@ -6,5 +6,5 @@ inline fun foo(f: () -> String) = f()
// MODULE: main(lib)
// FILE: main.kt
// PROPERTY_NOT_READ_FROM: foo_6r51u9$
// PROPERTY_NOT_READ_FROM: foo_h4ejuu$
fun box() = lib.foo { "OK" }
@@ -1,7 +1,7 @@
package foo
// CHECK_NOT_CALLED_IN_SCOPE: scope=test function=even
// CHECK_NOT_CALLED_IN_SCOPE: scope=test function=filter_azvtw4$
// CHECK_NOT_CALLED_IN_SCOPE: scope=test function=filter
internal inline fun even(x: Int) = x % 2 == 0
@@ -3,5 +3,5 @@ function A(v) {
}
function nativeBox(b) {
return b.bar_asnz92$(new A("foo"), function($reciever, i, s) { return "" + $reciever.v + s + i })
return b.bar_a13ma$(new A("foo"), function($reciever, i, s) { return "" + $reciever.v + s + i })
}
+6 -7
View File
@@ -70,16 +70,16 @@ function generateModel(path) {
function supplyAsserter(kotlin) {
function AsserterClass() {
}
AsserterClass.prototype.assertTrue_tup0fe$ = function(lazyMessage, actual) {
kotlin.kotlin.test.assertTrue_8kj6y5$(actual, lazyMessage());
AsserterClass.prototype.assertTrue_o10pc4$ = function(lazyMessage, actual) {
kotlin.kotlin.test.assertTrue_ifx8ge$(actual, lazyMessage());
};
AsserterClass.prototype.assertTrue_ivxn3r$ = function(message, actual) {
AsserterClass.prototype.assertTrue_4mavae$ = function(message, actual) {
if (!actual) {
this.failWithMessage(message);
}
};
AsserterClass.prototype.assertEquals_a59ba6$ = kotlin.kotlin.test.Asserter.prototype.assertEquals_a59ba6$;
AsserterClass.prototype.fail_61zpoe$ = function(message) {
AsserterClass.prototype.assertEquals_lzc6tz$ = kotlin.kotlin.test.Asserter.prototype.assertEquals_lzc6tz$;
AsserterClass.prototype.fail_pdl1vj$ = function(message) {
this.failWithMessage(message);
};
AsserterClass.prototype.failWithMessage = function(message) {
@@ -90,8 +90,7 @@ function supplyAsserter(kotlin) {
}
};
AsserterClass.$metadata$ = {
type: kotlin.TYPE.CLASS,
classIndex: kotlin.newClassIndex(),
type: kotlin.Kind.CLASS,
baseClasses: [kotlin.kotlin.test.Asserter]
};
kotlin.kotlin.test.asserter = new AsserterClass();