Closed facekapow closed 9 years ago
:+1: ah yeah, sorry, you're right, it needs to call String(text)
internally. I can fix this now or would you like to open a PR?
PR? Yeah.
Ok, Pull Request submitted. Waiting for merge.
it needs to call String(text) internally
Really? I think it's a waste of resources to create a String object instead of calling the .toString() method to get the string literal representation...
@piranna String(obj) is the same as obj.toString(), but also converts primitive values like null and undefined
:+1:
This is an issue I discovered while working with
runtime-node-net
. runtime'sruntime.tty.print()
function only accepts strings. You'd at least expect an error when given something else, but no. I tried printing an integer an nothing happened, no errors, nothing. CallingtoString()
on the number printed it. So I propose that the function should calltoString()
on the argument, which i'm believe is whatconsole.log()
does.