New issue
Advanced search Search tips

Issue 603890 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 499864
Owner: ----
Closed: Apr 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

devtools forcing auto params for /\{.*\}/ breaks some inputs

Reported by kolodny....@gmail.com, Apr 15 2016

Issue description

Chrome Version       : 49.0.2623.112 (Official Build) m (64-bit)
URLs (if applicable) :

What steps will reproduce the problem?
(1) Open the devtools
(2) Go to the console tab and type: 
(3) {a:1}),({b:2}

What is the expected result?
It should throw a syntax error


What happens instead?
It displays Object {b: 2}


Please provide any additional information below. Attach a screenshot if
possible.

I think it would make sense to try to first parse it by itself and see if it is a syntax error before doing the auto params, something as simple as Function(expression) should do the trick. Note that this will also solve for the problem of this input:

{let a = 4; console.log(a)}

So far the only way I've found to get around this is to do something like this:

/**/ {let a = 4; console.log(a)}

 
To solve for the let case, it should also check if adding the params would create a syntax error: Function('(' + expression + ')') and if so don't add them
Components: Platform>DevTools>JavaScript

Comment 4 by allada@chromium.org, Apr 29 2016

Mergedinto: 499864
Status: Duplicate (was: Unconfirmed)
Merging these to get it out of our bucket. #3 Confirmed it should fix it.

Sign in to add a comment