File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ the surrounding tooling.
10
10
11
11
## Inline JavaScript
12
12
13
- You can inline some JavaScript code into your Kotlin code using the [ ` js() ` ] ( https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.js/js.html ) function.
13
+ You can inline JavaScript code into your Kotlin code using the [ ` js() ` ] ( https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.js/js.html ) function.
14
14
For example:
15
15
16
16
``` kotlin
@@ -26,11 +26,16 @@ a string constant. So, the following code is incorrect:
26
26
fun jsTypeOf (o : Any ): String {
27
27
return js(getTypeof() + " o" ) // error reported here
28
28
}
29
+
29
30
fun getTypeof () = " typeof"
30
31
```
31
32
32
- Note that invoking ` js() ` returns a result of type [ ` dynamic ` ] ( dynamic-type.md ) , which provides no type safety at the
33
- compile time.
33
+ > As the JavaScript code is parsed by the Kotlin compiler, not all ECMAScript features might be supported.
34
+ > In this case, you can encounter compilation errors.
35
+ >
36
+ {style="note"}
37
+
38
+ Note that invoking ` js() ` returns a result of type [ ` dynamic ` ] ( dynamic-type.md ) , which provides no type safety at compile time.
34
39
35
40
## external modifier
36
41
You can’t perform that action at this time.
0 commit comments