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

Issue 638073 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

regular expression error in debug mode

Reported by zzz...@gmail.com, Aug 16 2016

Issue description

Chrome Version       : Version 54.0.2823.0
Other browsers tested: all will get a correct result except chromium
     chrome: OK
    Firefox: OK
         IE: OK

What steps will reproduce the problem?
(1) write these codes in your web:
    var re=/(b)/;
    var str="abc";
    re.test(str);
    console.log(RegExp.$1);
(2) open this page in chromium and debug it
(3) make a breakpoint at the 3th line
(4) step over to the next line and to see the result of console.log

What is the expected result?
it should be "b" as in the normal mode.

What happens instead?
but actuallly it will get "" in debug mode.


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

 
QQ截图20160816103255.jpg
4.9 KB View Download
Can't reproduce in Chrome 54.

Comment 2 by zzz...@gmail.com, Aug 18 2016

chromium not chrome
Components: Platform>DevTools
Labels: TE-NeedsTriaheHelp

Comment 5 by l...@chromium.org, Aug 19 2016

Cc: l...@chromium.org
Labels: -TE-NeedsTriaheHelp
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for the report zzzgoo@.

I'm able to reproduce on Mac 54.0.2832.2.  Hovering shows "" while console.log prints the "b" correctly.
RegExp.$1 is global variable it can be modified after any regexp usage. We use  regexp to format output in console.log and this variable can be changed.
I'm not able to reproduce it as is in current ToT but able to reproduce with other script:

var re=/(b)/;
var str="abc";
re.test(str);
debugger;
console.log(new Error(), RegExp.$1);
console.log(RegExp.$1 === "b")



Mergedinto: 595206
Status: Duplicate (was: Assigned)
This one would be fixed as soon as we migrate our injected-script-source to native.

Sign in to add a comment