console.log fails for anything other than a non-empty string
Aside from https://github.com/Samsung/iotjs/issues/133, console.log fails for anything other than a string; see script below, I've included the expected output as displayed by Node v0.10.40, Node v0.12.7 and io.js v2.4.0, and the latest build of IoT.js from the master branch.
// statement node/iojs iotjs
console.log('hello world') // hello world hello world
console.log(1) // 1 uncaughtException: undefined
console.log(9 + 10) // 19 uncaughtException: undefined
console.log(null) // null uncaughtException: undefined
console.log(true) // true uncaughtException: undefined
console.log(false) // false uncaughtException: undefined
console.log(undefined) // undefined uncaughtException: undefined
console.log(0.09) // 0.09 uncaughtException: undefined
console.log(NaN) // NaN uncaughtException: undefined
console.log(function () {}) // [Function] uncaughtException: undefined
console.log({}) // {} uncaughtException: undefined
console.log([]) // [] uncaughtException: undefined
@roryrjb Thanks for reporting it.
At this time console.log() only prints string and fails for any other arguments.
We are preparing equivalent functionality with node.js. but we have to wait implementation of String.prototype.replace() of JerryScripts. After that it'll print all this request.
@ILyoan thanks for your response. Keep up the good work :+1:
Close as #156 landed. Printing result is different from node.js since it requires not a few implementation. Feel free to reopen if needed.