Skip to content

Commit f5c4ff1

Browse files
authored
Do not expose Kotlin internal stuff (#1549)
1 parent 92b90a1 commit f5c4ff1

File tree

62 files changed

+856
-543
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+856
-543
lines changed

test-app/app/src/main/assets/app/mainpage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ require("./tests/kotlin/properties/testPropertiesSupport");
6060
require("./tests/kotlin/delegation/testDelegationSupport");
6161
require("./tests/kotlin/objects/testObjectsSupport");
6262
require("./tests/kotlin/functions/testTopLevelFunctionsSupport");
63-
require("./tests/kotlin/extensions/testExtensionFunctionsSupport")
63+
require("./tests/kotlin/extensions/testExtensionFunctionsSupport");
64+
require("./tests/kotlin/access/testInternalLanguageFeaturesSupport");
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
describe("Tests Kotlin internal language features should not be visible at runtime", function () {
2+
it("Test Kotlin internal functions in a kt file should not be exposed", function () {
3+
expect(com.tns.tests.kotlin.access.KotlinFileWithInternalFunctionsKt.someInternalFunction).toBe(undefined)
4+
});
5+
6+
it("Test Kotlin internal properties in a kt file should not be exposed", function () {
7+
expect(com.tns.tests.kotlin.access.KotlinFileWithInternalPropertiesKt.someInternalProperty).toBe(undefined)
8+
});
9+
10+
it("Test Kotlin internal class should not be exposed", function () {
11+
expect(com.tns.tests.kotlin.access.KotlinInternalClass).toBe(undefined)
12+
});
13+
14+
it("Test Kotlin internal companion in a class should not be exposed", function () {
15+
expect(com.tns.tests.kotlin.access.KotlinPublicClassWithInternalCompanion.Companion).toBe(undefined)
16+
});
17+
18+
it("Test Kotlin internal methods in a class should not be exposed", function () {
19+
var ktClass = new com.tns.tests.kotlin.access.KotlinPublicClassWithInternalMethods()
20+
expect(ktClass.someInternalMethod).toBe(undefined)
21+
});
22+
23+
it("Test Kotlin internal named companion in a class should not be exposed", function () {
24+
expect(com.tns.tests.kotlin.access.KotlinPublicClassWithInternalCompanion.SomeInternalCompanion).toBe(undefined)
25+
});
26+
27+
it("Test Kotlin internal nested class should not be exposed", function () {
28+
expect(com.tns.tests.kotlin.access.KotlinPublicClassWithInternalNestedClass.SomeNestedClass).toBe(undefined)
29+
});
30+
31+
it("Test Kotlin internal properties in a class should not be exposed", function () {
32+
var ktClass = new com.tns.tests.kotlin.access.KotlinPublicClassWithInternalProperties()
33+
expect(ktClass.someInternalProperty).toBe(undefined)
34+
});
35+
36+
it("Test Kotlin internal object should not be exposed", function () {
37+
expect(com.tns.tests.kotlin.access.KotlinInternalObject).toBe(undefined)
38+
});
39+
40+
it("Test Kotlin internal interface should not be exposed", function () {
41+
expect(com.tns.tests.kotlin.access.KotlinInternalInterface).toBe(undefined)
42+
});
43+
44+
it("Test Kotlin internal enum should not be exposed", function () {
45+
expect(com.tns.tests.kotlin.access.KotlinInternalEnum).toBe(undefined)
46+
});
47+
48+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.tns.tests.kotlin.access
2+
3+
internal fun someInternalFunction(){
4+
5+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package com.tns.tests.kotlin.access
2+
3+
internal val someInternalProperty = 42
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package com.tns.tests.kotlin.access
2+
3+
internal class KotlinInternalClass
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.tns.tests.kotlin.access
2+
3+
internal enum class KotlinInternalEnum {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.tns.tests.kotlin.access
2+
3+
internal interface KotlinInternalInterface {
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.tns.tests.kotlin.access
2+
3+
internal object KotlinInternalObject {
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.tns.tests.kotlin.access
2+
3+
class KotlinPublicClassWithInternalCompanion {
4+
internal companion object {
5+
fun someInternalCompanionMethod(){
6+
7+
}
8+
}
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.tns.tests.kotlin.access
2+
3+
class KotlinPublicClassWithInternalMethods {
4+
internal fun someInternalMethod(){
5+
6+
}
7+
}

0 commit comments

Comments
 (0)