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)
,
Aug 13
,
Aug 14
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)
,
Sep 21
Looks fixed in current stable and in ToT. Thanks for your report! |
|||
►
Sign in to add a comment |
|||
Comment 1 by krajshree@chromium.org
, Aug 9Labels: Needs-Triage-M68 Triaged-ET Needs-Feedback