Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #14992

Re: Access local & closure variables for debugging purposes

From "Scott Sauyet" <3103invalid@webnews.fastusenet.org>
Newsgroups comp.lang.javascript
Subject Re: Access local & closure variables for debugging purposes
Message-ID <201207101115423103@webnews.fastusenet.org> (permalink)
References <ac883590-6b9c-4c27-a6b5-aa0b9e9c6c45@googlegroups.com>
Date 2012-07-10 11:15 +0000

Show all headers | View raw


juzna.cz@gmail.com wrote:

> when debugging javascript applications I often encounter a situation,
> where I need to see local variables of a function & variables which a 
> function closes over ("closure variables").
> 
> This is possible in Chrome's Web Inspector in Scripts panel when I'm 
> debugging - I can see "Scope Variables" panel on the right with sections 
> Local, Closure and Global.
> 
> Is it somehow possible to access these variables from javascript itself? 
> Probably within code running within webinspector's console.

Those variables are available by name to your local code.  You don't have 
to do anything special to access the individual variables.  But I don't 
think any standard environments offer you facilities to list them.

  -- Scott

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Access local & closure variables for debugging purposes juzna.cz@gmail.com - 2012-07-09 10:49 -0700
  Re: Access local & closure variables for debugging purposes "Scott Sauyet" <3103invalid@webnews.fastusenet.org> - 2012-07-10 11:15 +0000

csiph-web