Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Feature Idea: View all scope variables inside of console
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Brian Grinstead  
View profile  
 More options Sep 12 2012, 10:04 pm
From: Brian Grinstead <briangrinst...@gmail.com>
Date: Wed, 12 Sep 2012 19:04:04 -0700 (PDT)
Local: Wed, Sep 12 2012 10:04 pm
Subject: Feature Idea: View all scope variables inside of console

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-s....
 Is there any interest in a feature like this?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yury Semikhatsky  
View profile  
 More options Sep 17 2012, 7:53 am
From: Yury Semikhatsky <yu...@chromium.org>
Date: Mon, 17 Sep 2012 15:53:10 +0400
Local: Mon, Sep 17 2012 7:53 am
Subject: Re: [Chrome DevTools] Feature Idea: View all scope variables inside of console

This would require storing references to all objects accessible from the
scope chain and may lead to memory leaks caused by DevTools keeping the
objects alive. Although I believe the feature can be useful I don't think
we should blindly store the whole scope chain.

Yury

On Thu, Sep 13, 2012 at 6:04 AM, Brian Grinstead
<briangrinst...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John J Barton  
View profile  
 More options Sep 17 2012, 6:31 pm
From: John J Barton <johnjbar...@johnjbarton.com>
Date: Mon, 17 Sep 2012 15:30:59 -0700
Local: Mon, Sep 17 2012 6:30 pm
Subject: Re: [Chrome DevTools] Feature Idea: View all scope variables inside of console

On Mon, Sep 17, 2012 at 4:53 AM, Yury Semikhatsky <yu...@chromium.org> wrote:
> This would require storing references to all objects accessible from the
> scope chain and may lead to memory leaks caused by DevTools keeping the
> objects alive. Although I believe the feature can be useful I don't think we
> should blindly store the whole scope chain.

Rather than storing the references, one could copy them into
'representation' objects which only reference other representation
objects not the heap. The representation for primitives would be
primitives. Representation of the DOM would be a string like "<input
type='text'>...". So the result object would be large but it would not
point outside of itself; as soon as the console is cleared the large
object would be GC fodder. (This is similar to rendering the object to
text without actually rendering it).

For small programs or large closures each representation could be
larger than the program heap. To reduce the performance impact,
console.scope() could take a "depth" argument, where leaves at depth
are rendered to strings. Thus console.depth(1) would give the same
picture as Brian's blog post but the twistys would all give
"console.scope rendered at depth 1" or some such.

jjb


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pavel Feldman  
View profile  
 More options Sep 18 2012, 2:22 am
From: Pavel Feldman <pfeld...@chromium.org>
Date: Tue, 18 Sep 2012 10:22:30 +0400
Local: Tues, Sep 18 2012 2:22 am
Subject: Re: [Chrome DevTools] Feature Idea: View all scope variables inside of console

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
On Sep 18, 2012 1:31 AM, "John J Barton" <johnjbar...@johnjbarton.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »