Fix passing non-string value to print/println in node.js

See KT-15484
This commit is contained in:
Alexey Andreev
2017-03-21 18:45:49 +03:00
parent dbfa3fce2a
commit 7077de02e7
3 changed files with 14 additions and 5 deletions
+2 -2
View File
@@ -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("")
}
}