[devtools] watch expressions fails to detect functions in closure-scope
Reported by
kaycebas...@gmail.com,
Sep 5 2017
|
|||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.0 Safari/537.36
Steps to reproduce the problem:
1. Add Watch Expressions for `a` and `b` and `c`.
1. Run the following as a Snippet:
var globalV = 123;
(function(){
var a = function(){};
var b = function(){a();};
var c = function(){b();};
var d = function(){
debugger;
c();
};
d();
})();
What is the expected behavior?
Watch Expressions detects that `a` and `b` are functions.
What went wrong?
Watch Expressions says that `a` and `b` are `<not available>`.
Did this work before? N/A
Chrome version: 62.0.3202.0 Channel: canary
OS Version: OS X 10.12.6
Flash Version:
Note that Watch Expressions does successfully detect that `c` is a function.
Source of bug report: https://stackoverflow.com/questions/46048956
,
Sep 6 2017
@kaycebasques -- Thanks for reporting this issue. Could you please provide the exact expected behavior, as '<not available>' is not displayed for variables under "Watch" section on the reported Chrome version #62.0.3202.0 and latest Canary #63.0.3206.0 on Mac 10.12.6 and Windows 7. Attached the screenshot for reference. Could you please try by removing the extensions and creating a new profile to verify if the issue still persists. Thanks in advance.
,
Sep 6 2017
@pnangunoori As I mention in step 1, you need to define watch expressions for `a`, `b`, and `c`. I can see in your screenshot that you did not do that. https://developers.google.com/web/tools/chrome-devtools/javascript/reference#watch
,
Sep 6 2017
Look at the section titled "Watch" in my original screenshot for a comparison. That is where the bug occurs.
,
Sep 6 2017
Thank you for providing more feedback. Adding requester "pnangunoori@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 6 2017
,
Sep 7 2017
Able to reproduce the issue on Ubuntu 14.04, Windows 7 and Mac 10.12.6 with the reported version 62.0.3202.0 dev and latest canary 63.0.3208.0 with steps mentioned in comment#0 Issue is reproducible on M-50 [50.0.2624.0] and working fine on firefox i.e; Watch Expressions a and b are also seen as functions. Attaching screencast for reference. Hence, marking it as Untriaged and adding appropriate labels for further investigation.
,
Sep 11 2017
,
Sep 11 2017
The root - V8 optimization which removes unused variables from outer scope in current function. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by ajha@chromium.org
, Sep 6 2017