Updates:
        Summary: Local variables of non-topmost stack frames cannot be inspected
        Status: Accepted

Comment #4 on issue 2820 by [email protected]: Local variables of non-topmost stack frames cannot be inspected
http://code.google.com/p/v8/issues/detail?id=2820

OK, so the issue here is:
Chrome DevTools doesn't allow you to inspect callers' local variables. I guess it would be nice to have that functionality.


Workarounds in the meantime:

1) From the breakpoint, step line by line until you're back in "myFunction"'s scope (where you can see the value of "param"), or even further until you're back in the anonymous outer closure's scope (where "c" is a local).

2) Use console.log to print both c (or param) and ret.

3) Refactor this callback passing style:

function myFunction(param, cb) { cb(some_expression_of(param)); }
myFunction(c, function callback(x) { do_something_with(x); });

to plain and simple imperative style:

function myFunction(param) { return some_expression_of(param); }
var x = myFunction(c); do_something_with(x);

Which will have x and c in the same local scope, and as a nice side effect will probably also run a little faster.

4) In the example case at hand, you're probably looking for the difference between "param^2" and "param*param" or "Math.pow(param, 2)" ;-)

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to