Closed
Bug 1650670
Opened 5 years ago
Closed 5 years ago
Console instant evaluation updates lastIndex of RegExp as side-effect
Categories
(DevTools :: Console, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1609429
People
(Reporter: lucas.werkmeister, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0
Steps to reproduce:
- Open any page, e. g. about:blank
- Open the Developer Tools Console (Ctrl+Shift+K)
- Run
const re = /./g; - Run
const s = 'abc'; - Enter
re.exec(s), observe instant evaluation preview - Press Enter to run that command
- Type Up arrow to recall that command, observe instant evaluation preview
- Press Enter to run that command again
Actual results:
- First preview is
[ "a" ] - First actual result is
[ "b" ] - Second preview is
[ "c" ] - Second actual result is
null
Expected results:
- First actual result is
[ "a" ] - Second actual result is
[ "b" ] - Either the previews should be identical to those results (i. e., evaluate the
exec, but then discard the change tore.lastIndex), or Firefox should detect that the command has a side-effect (updatingre.lastIndex) and not show any preview.
Comment 1•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Component: Untriaged → Console
Product: Firefox → DevTools
Updated•5 years ago
|
Blocks: console-instant-eval
Updated•5 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•