Skip to content

Commit 04a2d0d

Browse files
committed
Docs in JS Kotlin; Properly logs output in TS code
1 parent f6ab547 commit 04a2d0d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src-js/src/main/kotlin/calculator/Calculator.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,17 @@ package calculator
55

66
import kotlin.js.JsName
77

8+
@JsName("log")
89
actual fun log(msg: String) = console.log(msg)
910

1011
@JsName("root")
11-
fun main(args: Array<String>) {
12+
fun root(args: Array<String>) {
1213
Calculator.runExperiments()
1314
}
15+
16+
/**
17+
* We don't actually need a main routine for JS-KT. However, if we do write
18+
* one, it will execute immediately on loading the module.
19+
*/
20+
// @JsName("main")
21+
// fun main(args: Array<String>) {}

ts/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ const kotlin = require('kotlin');
22

33
import * as srcJsOutput from '../src-js/build/js/index';
44

5+
console.log(`\nsrcJsOutput (output of ./src-js/*):`);
56
console.log(srcJsOutput);

0 commit comments

Comments
 (0)