Fix passing non-string value to print/println in node.js
See KT-15484
This commit is contained in:
@@ -34,7 +34,7 @@ private abstract class BaseOutput {
|
||||
/** JsName used to make the declaration available outside of module to test it */
|
||||
@JsName("NodeJsOutput")
|
||||
private class NodeJsOutput(val outputStream: dynamic) : BaseOutput() {
|
||||
override fun print(message: Any?) = outputStream.write(message)
|
||||
override fun print(message: Any?) = outputStream.write(String(message))
|
||||
}
|
||||
|
||||
/** JsName used to make the declaration available outside of module to test it */
|
||||
@@ -49,7 +49,7 @@ private class OutputToConsoleLog : BaseOutput() {
|
||||
}
|
||||
|
||||
override fun println() {
|
||||
console.log()
|
||||
console.log("")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user