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

Issue 771301 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 679274
Owner:
Last visit > 30 days ago
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Throwing an exception while evaluating a let statement in devtools causes the variable to become defined and undefined

Project Member Reported by rdevlin....@chromium.org, Oct 3 2017

Issue description

What steps will reproduce the problem?
1. visit example.com
2. open devtools
3. enter the following code (line by line, don't copy paste)
let foo = bar;  // throws error
let foo = 1;    // throws error
foo = 1;        // throws error

What is the expected result?
foo should be defined or not defined, but not both.

What happens instead of that?
foo has become Schrödinger's variable, defined and not defined simultaneously.

let foo = bar;
(unknown) Uncaught ReferenceError: bar is not defined    << Expected

let foo = 1;
(unknown) Uncaught SyntaxError: Identifier 'foo' has already been declared

foo = 1;
(unknown) Uncaught ReferenceError: foo is not defined




Not sure if this is devtools or v8, but I don't think there's a sane non-devtools way to trigger this, so starting there.
 

Comment 1 by alph@chromium.org, Oct 10 2017

Components: -Platform>DevTools Platform>DevTools>JavaScript
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Untriaged)
Mergedinto: 679274
Status: Duplicate (was: Assigned)
It's V8/DevTools issue. V8 Inspector should use DebugEvaluate::Global and DebugEvaluate::Global should support scoped variables.

Sign in to add a comment