You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I copied some code over from Android to ios; and found out the console.dump doesn't work. Shouldn't we take the same dump routine that is available on the ios and patch the console prototype to use it?
IMO, if we want to support it on iOS, the same as we do on Android, we have to add the same implementation from the modules in the runtime, which is suboptimal and error-prone. I think, that the dump method (and any other custom one) should be added in the NativeScript modules, so that it can work the same on iOS and Android.
IMO, instead of modifying internal JavaScript objects we should replace the console.dump(obj) method with console.log(f(obj)), where f is something like util.inspect() in node.
One of the first thing I do, no matter if it's a {N} project or a Node project, is that I add eyes.js for outputing stuff. Colorized and nice formatted. I could definitely see this being a core part of {N}.
Footnote:
Unfortunately eyes asks for process.stdout. To make it work in a {N} context you've to change Line 34 from stream: process.stdout, to stream: null.
Activity
enchev commentedon Sep 23, 2015
From @jasssonpet on September 23, 2015 7:53
console.dump()isn't implemented in any of the following popular APIs:IMO, if we want to support it on iOS, the same as we do on Android, we have to add the same implementation from the modules in the runtime, which is suboptimal and error-prone. I think, that the
dumpmethod (and any other custom one) should be added in the NativeScript modules, so that it can work the same on iOS and Android.IMO, instead of modifying internal JavaScript objects we should replace the
console.dump(obj)method withconsole.log(f(obj)), wherefis something like util.inspect() in node.Related to: NativeScript/ios-jsc#261
NathanaelA commentedon Sep 23, 2015
valentinstoychev commentedon Sep 23, 2015
@NathanaelA - consistency is a major concern here and it is with biggest priority for us, so we will make sure to fix this. cc: @atanasovg
emiloberg commentedon Sep 23, 2015
One of the first thing I do, no matter if it's a {N} project or a Node project, is that I add eyes.js for outputing stuff. Colorized and nice formatted. I could definitely see this being a core part of {N}.
Footnote:
Unfortunately eyes asks for
process.stdout. To make it work in a {N} context you've to change Line 34 fromstream: process.stdout,tostream: null.enchev commentedon Sep 24, 2015
I've just merged to master
console.dumpfor iOS and I'm closing this.lock commentedon Aug 30, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.