New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 762265 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 498454
Owner:
Last visit > 30 days ago
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

[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
 
watch.png
190 KB View Download

Comment 1 by ajha@chromium.org, Sep 6 2017

Labels: Needs-Triage-M62
Cc: pnangunoori@chromium.org
Labels: Needs-Feedback
@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.
762265.png
171 KB View Download
@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
Look at the section titled "Watch" in my original screenshot for a comparison. That is where the bug occurs.
Project Member

Comment 5 by sheriffbot@chromium.org, Sep 6 2017

Labels: -Needs-Feedback
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
Cc: ligim...@chromium.org
Labels: Needs-Bisect
Cc: sc00335...@techmahindra.com
Labels: -Needs-Bisect Triaged-ET M-63 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
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.
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Untriaged)
Mergedinto: 498454
Status: Duplicate (was: Assigned)
The root - V8 optimization which removes unused variables from outer scope in current function.

Sign in to add a comment