Feature Request: Add Arguments to Scope Variables

31 views
Skip to first unread message

Jason Laster

unread,
Mar 5, 2015, 1:39:24 PM3/5/15
to google-chrome-...@googlegroups.com
Hey all, I'm writing to see if you think it'd be a good idea to add an "arguments" field to the local scope variables pane. If you like the idea, I'd be happy to create a ticket. 

I think it'd be nice for the sake of completeness. Also, there are many cases where a function's params are overloaded. The counter argument is that it is rarely used.

I started a patch here:

Here are some of the notes I published:

The notes are going to be rough. I published them mostly as an educational experience for myself. With that said, I also noticed that there is little material out there on the Inspector's internals. I'm thinking of sharing some more notes on (main.js, runtime.js, InspectorBackend.js) going forward. 

I'm really curious what you think of the patch. Even if the feature does not move forward I'd like to use this as a learning experience. One thing that I'm curious about is there an easy way to fetch to `arguments` value for a given call frame?

Thanks in advance!

Yury Semikhatsky

unread,
Mar 6, 2015, 5:38:56 AM3/6/15
to Google Chrome Developer Tools
On Thu, Mar 5, 2015 at 9:39 PM, Jason Laster <jason.l...@gmail.com> wrote:
Hey all, I'm writing to see if you think it'd be a good idea to add an "arguments" field to the local scope variables pane. If you like the idea, I'd be happy to create a ticket. 

Feature requests at crbug.com is generally a good place for discussions like this.
 
I think it'd be nice for the sake of completeness. Also, there are many cases where a function's params are overloaded. The counter argument is that it is rarely used.

I started a patch here:

Here are some of the notes I published:

The notes are going to be rough. I published them mostly as an educational experience for myself. With that said, I also noticed that there is little material out there on the Inspector's internals.
We've been trying to keep the code self-documenting as otherwise documentation  very quickly becomes obsolete (we observe it with the user documentation too).
 
I'm thinking of sharing some more notes on (main.js, runtime.js, InspectorBackend.js) going forward. 

This may be useful for other contributors.
 
I'm really curious what you think of the patch.
In this case I'd like to take a look at the backend part to see if it can be implemented without regressing performance.
 
Even if the feature does not move forward I'd like to use this as a learning experience. One thing that I'm curious about is there an easy way to fetch to `arguments` value for a given call frame?

Not really. Accessing arguments variable in function makes v8 generate additional code and disable some optimizations for the function. So the arguments object is created only if it is reference in function's body and if it is created you will see it in Local scope of that function. In general is no much difference between function parameters and regular local variables that's we don't differentiate between them in Local scope and internally in v8.
 

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/729226e9-e0b9-4932-8596-5a0fdc11017f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Laster

unread,
Mar 6, 2015, 12:48:36 PM3/6/15
to google-chrome-...@googlegroups.com
Thanks Yury for the reply.

Happy to start issues in crbug. I wasn't sure if it was a good place for feature requests. Also, didn't see too many devtools features/issues. 

I feel better seeing that arguments is available when used in the function body. http://cl.ly/a6ER 




For more options, visit https://groups.google.com/d/optout.



--

-- 
Jason Laster
Software Engineer
  Etsy  

Sandip Chitale

unread,
Mar 8, 2015, 11:05:25 AM3/8/15
to google-chrome-...@googlegroups.com
You can always add a watch expression 'arguments'.


On Friday, March 6, 2015 at 9:48:36 AM UTC-8, Jason Laster wrote:
Thanks Yury for the reply.

Happy to start issues in crbug. I wasn't sure if it was a good place for feature requests. Also, didn't see too many devtools features/issues. 

I feel better seeing that arguments is available when used in the function body. http://cl.ly/a6ER 


On Fri, Mar 6, 2015 at 5:38 AM, Yury Semikhatsky <yu...@chromium.org> wrote:
On Thu, Mar 5, 2015 at 9:39 PM, Jason Laster <jason.l...@gmail.com> wrote:
Hey all, I'm writing to see if you think it'd be a good idea to add an "arguments" field to the local scope variables pane. If you like the idea, I'd be happy to create a ticket. 

Feature requests at crbug.com is generally a good place for discussions like this.
 
I think it'd be nice for the sake of completeness. Also, there are many cases where a function's params are overloaded. The counter argument is that it is rarely used.

I started a patch here:

Here are some of the notes I published:

The notes are going to be rough. I published them mostly as an educational experience for myself. With that said, I also noticed that there is little material out there on the Inspector's internals.
We've been trying to keep the code self-documenting as otherwise documentation  very quickly becomes obsolete (we observe it with the user documentation too).
 
I'm thinking of sharing some more notes on (main.js, runtime.js, InspectorBackend.js) going forward. 

This may be useful for other contributors.
 
I'm really curious what you think of the patch.
In this case I'd like to take a look at the backend part to see if it can be implemented without regressing performance.
 
Even if the feature does not move forward I'd like to use this as a learning experience. One thing that I'm curious about is there an easy way to fetch to `arguments` value for a given call frame?

Not really. Accessing arguments variable in function makes v8 generate additional code and disable some optimizations for the function. So the arguments object is created only if it is reference in function's body and if it is created you will see it in Local scope of that function. In general is no much difference between function parameters and regular local variables that's we don't differentiate between them in Local scope and internally in v8.
 

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages