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

Issue 872566 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

ReferenceError thrown for lop-level variables in script file of type="module"

Reported by ma...@alchemycodelab.com, Aug 9

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

Steps to reproduce the problem:
1. Create an index.mjs or index.js with
```
let x = 12; 
console.log(x);
```

2. Include in html page via <script type="module"...
3. Set a breakpoint on line 2
4. When stopped, try and inspect x:
    a. hover over variable in source
    b. type `x` on console
    c. Watch on `x` shows notavailable
    d. ("Locals" is missing altogether)

What is the expected behavior?
variable is in scope

What went wrong?
Throws ReferenceError 

Did this work before? N/A 

Chrome version: 68.0.3440.106  Channel: stable
OS Version: OS X 10.13.6
Flash Version: 

Appears to be for all top level variables plus declared functions. Variables inside functions behave correctly. (nested scope okay, just top-level module)
 
Cc: krajshree@chromium.org
Labels: Needs-Triage-M68 Triaged-ET Needs-Feedback
marty@ - Thanks for filing the issue...!!

Could you please provide a sample test file/url to test the issue from TE-end.
This will help us in triaging the issue further.

Thanks...!!
Owner: kozy@chromium.org
Status: Assigned (was: Unconfirmed)
Have dev tools open and load index.html. It will stop on the debugger statement and then follow steps to reproduce (try and inspect x) 
index.html
46 bytes View Download
index.js
21 bytes View Download
Status: Fixed (was: Assigned)
Looks fixed in current stable and in ToT. Thanks for your report!

Sign in to add a comment