WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
59474
Web Inspector: [protocol] evaluate* methods should accept 'additional context' param
https://bugs.webkit.org/show_bug.cgi?id=59474
Summary
Web Inspector: [protocol] evaluate* methods should accept 'additional context...
Peter Rybin
Reported
2011-04-26 11:33:00 PDT
When evaluating expression client should be able to refer to a particular remote object that cannot be accessed by name. Additional binding objectID -> name in local scope should be provided. Protocol commands "evaluate*" should accept 'additional context' parameter in form [ { "name": <name>, "objectID": <objectID> } ] The expression should be evaluated with additional names/values binded to a local scope. E.g. user expression "nextRandomColor()" evaluated to object with id 5. Protocol let explore its properties. Protocol should also let evaluate string representation of the object: non-user expression "String(val)" with additional context [ { "name":"val", "objectID": 5 } ].
Attachments
Add attachment
proposed patch, testcase, etc.
Patrick Mueller
Comment 1
2011-04-26 12:56:23 PDT
In your example, where is the user getting the objectId value of 5 from? From exploring some other object? I find it hard to imagine that people would use this sort of functionality. Here's what I'd run, in the console. x = nextRandomColor() String(x) After typing the first line, you can explore the result a bit. Then type the second line and explore that a bit. It has the side effect of setting an "x" variable in some scope (presumably global scope). But I rarely care about that. Do you have another use case?
Peter Rybin
Comment 2
2011-04-26 15:42:48 PDT
(In reply to
comment #1
)
> In your example, where is the user getting the objectId value of 5 from? From exploring some other object? I find it hard to imagine that people would use this sort of functionality. > > Here's what I'd run, in the console. > > x = nextRandomColor() > String(x) > > After typing the first line, you can explore the result a bit. Then type the second line and explore that a bit. > > It has the side effect of setting an "x" variable in some scope (presumably global scope). But I rarely care about that. > > Do you have another use case?
It is needed for Eclipse-based client, which doesn't have console. The Eclipse UI assumes that you can point to any value (in Variables or Expressions views) and you see its string representation. Other feature is to "pin-point" any value as a global object property (
http://code.google.com/p/chromedevtools/wiki/EclipseDebuggerFeatures
). The "non-user expression" (one with id) is generated. That's how Java client manipulates values (except for looking up properties, which is done by a dedicated protocol command).
Patrick Mueller
Comment 3
2011-04-27 03:40:19 PDT
(In reply to
comment #2
)
> It is needed for Eclipse-based client, which doesn't have console. ...
I see. I was confused, I thought you were expecting this to be exposed somehow through the console. Exposed just through the protocol APIs makes a lot more sense.
Peter Rybin
Comment 4
2011-07-19 08:09:31 PDT
This feature was considered harmful (?) in discussion as too powerful.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug