While debugging in WebStorm (2016.1), the debugger breaks after console.log(arguments)
. Here's an example:
function breakDebug() {
console.log(arguments);
}
breakDebug();
console.log("still kickin'"); // WS will not stop on breakpoint here
This can be solved by converting arguments
to some type that won't choke debugger (array
, object
or whatever) on the caller side, something like this:
function digestible(args) {
return Array.prototype.slice.call(args);
}
function breakDebug() {
console.log(digestible(arguments)); // this is cumbersome
}
breakDebug();
console.log("still kickin'"); // this time debugger stops
// on breakpoint here
Instead of explicitly converting arguments to array, is there some safe voodoo that could be performed over console
object that would make the first snippet not break the debugger? By safe I mean compliant to all the best practices a JS n00b like me doesn't know about.
As a side question, should I report this to JetBrains?