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); 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() { Kotlin.Long.prototype.inc = function() {
return this.add(Kotlin.Long.ONE); return this.add(Kotlin.Long.ONE);
+1 -1
View File
@@ -26,7 +26,7 @@ Kotlin.compareTo = function (a, b) {
if (typeA == "number" || typeA == "string") { if (typeA == "number" || typeA == "string") {
return a < b ? -1 : a > b ? 1 : 0; return a < b ? -1 : a > b ? 1 : 0;
} }
return a.compareTo_za3rmp$(b); return a.compareTo_11rb$(b);
}; };
Kotlin.primitiveCompareTo = function (a, b) { Kotlin.primitiveCompareTo = function (a, b) {
@@ -57,7 +57,7 @@ fun test(expected: String, f: () -> Unit) {
val STABLE_EQUALS = "equals" val STABLE_EQUALS = "equals"
val STABLE_HASH_CODE = "hashCode" val STABLE_HASH_CODE = "hashCode"
val STABLE_TO_STRING = "toString" 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_HASH_CODE_2 = "hashCode_za3lpa$"
val STABLE_TO_STRING_2 = "toString_61zpoe$" 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: test4_buocd8$ except=imul
// CHECK_CONTAINS_NO_CALLS: test5 except=imul // CHECK_CONTAINS_NO_CALLS: test5 except=imul
// CHECK_HAS_INLINE_METADATA: apply // CHECK_HAS_INLINE_METADATA: apply
// CHECK_HAS_INLINE_METADATA: applyL_hiyix$ // CHECK_HAS_INLINE_METADATA: applyL_h43q6c$
// CHECK_HAS_INLINE_METADATA: applyM_hiyix$ // CHECK_HAS_INLINE_METADATA: applyM_h43q6c$
// CHECK_HAS_NO_INLINE_METADATA: applyN_hiyix$ // CHECK_HAS_NO_INLINE_METADATA: applyN_h43q6c$
// CHECK_HAS_NO_INLINE_METADATA: applyO_hiyix$ // CHECK_HAS_NO_INLINE_METADATA: applyO_h43q6c$
inline inline
public fun <T> apply(arg: T, func: (T)->T): T = func(arg) 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=set_vux9f0$ scope=box
// CHECK_NOT_CALLED_IN_SCOPE: function=dec 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=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 { class A {
inline operator fun plus(a: Int) = a + 10 inline operator fun plus(a: Int) = a + 10
@@ -6,5 +6,5 @@ inline fun foo(f: () -> String) = f()
// MODULE: main(lib) // MODULE: main(lib)
// FILE: main.kt // FILE: main.kt
// PROPERTY_NOT_READ_FROM: foo_6r51u9$ // PROPERTY_NOT_READ_FROM: foo_h4ejuu$
fun box() = lib.foo { "OK" } fun box() = lib.foo { "OK" }
@@ -1,7 +1,7 @@
package foo package foo
// CHECK_NOT_CALLED_IN_SCOPE: scope=test function=even // 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 internal inline fun even(x: Int) = x % 2 == 0
@@ -3,5 +3,5 @@ function A(v) {
} }
function nativeBox(b) { 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 supplyAsserter(kotlin) {
function AsserterClass() { function AsserterClass() {
} }
AsserterClass.prototype.assertTrue_tup0fe$ = function(lazyMessage, actual) { AsserterClass.prototype.assertTrue_o10pc4$ = function(lazyMessage, actual) {
kotlin.kotlin.test.assertTrue_8kj6y5$(actual, lazyMessage()); kotlin.kotlin.test.assertTrue_ifx8ge$(actual, lazyMessage());
}; };
AsserterClass.prototype.assertTrue_ivxn3r$ = function(message, actual) { AsserterClass.prototype.assertTrue_4mavae$ = function(message, actual) {
if (!actual) { if (!actual) {
this.failWithMessage(message); this.failWithMessage(message);
} }
}; };
AsserterClass.prototype.assertEquals_a59ba6$ = kotlin.kotlin.test.Asserter.prototype.assertEquals_a59ba6$; AsserterClass.prototype.assertEquals_lzc6tz$ = kotlin.kotlin.test.Asserter.prototype.assertEquals_lzc6tz$;
AsserterClass.prototype.fail_61zpoe$ = function(message) { AsserterClass.prototype.fail_pdl1vj$ = function(message) {
this.failWithMessage(message); this.failWithMessage(message);
}; };
AsserterClass.prototype.failWithMessage = function(message) { AsserterClass.prototype.failWithMessage = function(message) {
@@ -90,8 +90,7 @@ function supplyAsserter(kotlin) {
} }
}; };
AsserterClass.$metadata$ = { AsserterClass.$metadata$ = {
type: kotlin.TYPE.CLASS, type: kotlin.Kind.CLASS,
classIndex: kotlin.newClassIndex(),
baseClasses: [kotlin.kotlin.test.Asserter] baseClasses: [kotlin.kotlin.test.Asserter]
}; };
kotlin.kotlin.test.asserter = new AsserterClass(); kotlin.kotlin.test.asserter = new AsserterClass();