I've been thinking about a feature that would save me some time when working with DevTools. The basic idea is that sometimes I just want to log all (or many) of the variables inside of a function, and it can be a bit of work to copy all of the variable names into the console.log() call when I know that I am just going to delete the line afterwards anyway. I would propose a solution called console.scope() that is similar to console.trace(), but it logs scope variables instead of the call stack.I wrote a post detailing this a little more: http://www.briangrinstead.com/blog/devtools-feature-request-console-scope. Is there any interest in a feature like this?
console.log already generates representation disconnected from the heap, it abbreviates strings with a hard-coded threshold and goes 1 level deep (i.e. does not dive into the composite objects).
We can dump scopes using it, but I wonder whether it generates too much noise (scopes are chained and the dumps can get really large). So you also might want to control the depth of enclosing scopes to dump.
Another concern is that we currently operate scopes in debugger only (i.e. while stopped), so it is not that easy to implement - we would need to get scope info at runtime. Depending of the complexity of these we might decide to hold it off.
I wonder if special-casing console.log(arguments) to dump all its items would cover a percentage of your needs. In either case, please file a bug at crbug.org.
Regards
Pavel