[CR-KT-22998] docs: add README for visibility change of variables
diff --git a/libraries/stdlib/wasm/builtins/kotlin/README.md b/libraries/stdlib/wasm/builtins/kotlin/README.md
new file mode 100644
index 0000000..fa1943c
--- /dev/null
+++ b/libraries/stdlib/wasm/builtins/kotlin/README.md
@@ -0,0 +1,15 @@
+# Kotlin/Wasm String Implementation Changes
+
+## Overview
+This pull request (KT-77056) changes the visibility of two properties in the `String` class from `private` to `internal`:
+- `leftIfInSum`: Used for string concatenation operations
+- `_chars`: Stores the character array for the string
+
+## Rationale
+The visibility change from `private` to `internal` prevents the generation of synthetic accessors when these properties are accessed from other classes within the same module. This optimization improves performance and reduces the size of the generated WebAssembly code.
+
+## Impact
+This change is an implementation detail that does not affect the public API of the Kotlin standard library. It only affects the internal implementation of the `String` class for the WebAssembly target.
+
+## Related Issues
+- [KT-77056] fix(String): change private declarations to internal
\ No newline at end of file
diff --git a/libraries/stdlib/wasm/builtins/kotlin/String.kt b/libraries/stdlib/wasm/builtins/kotlin/String.kt
index 4bfda67..2142462 100644
--- a/libraries/stdlib/wasm/builtins/kotlin/String.kt
+++ b/libraries/stdlib/wasm/builtins/kotlin/String.kt
@@ -13,9 +13,17 @@
* implemented as instances of this class.
*/
public actual class String internal @WasmPrimitiveConstructor constructor(
+ /**
+ * Used for string concatenation operations.
+ * Internal visibility prevents synthetic accessor generation, improving performance.
+ */
internal var leftIfInSum: String?,
@kotlin.internal.IntrinsicConstEvaluation
public actual override val length: Int,
+ /**
+ * Stores the character array for the string.
+ * Internal visibility prevents synthetic accessor generation, improving performance.
+ */
internal var _chars: WasmCharArray,
) : Comparable<String>, CharSequence {
public actual companion object {}