breakpoint stop at wrong line
Categories
(DevTools :: Debugger, defect, P3)
Tracking
(Not tracked)
People
(Reporter: h5on1, Unassigned)
Details
Attachments
(1 file)
276.86 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0
Steps to reproduce:
I build a webpage, and use new Function to convert string to callable function.
I place some debugger code inside the string.
I open developer tools and refresh the page.
Firefox developer tools stop the code execution and show the source panel so I can debug.
below is the sample html file that can reproduce the issue
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<script>
/**
* debugger is located at line 2
* expect breakpoint stop at line 2
* but firefox developer tool stop at line 4
*/
let f = new Function(`console.log(1);\ndebugger;\nconsole.log(3);\nconsole.log(4);\n`);
f.apply(this, []);
</script>
</body>
</html>
Actual results:
firefox developer tools breakpoint stop at wrong line, 2 line after the real code
Expected results:
firefox developer tools should stop at the line where debugger is at
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Debugger' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•3 years ago
|
||
We have an offset of 2 lines compared to the debugger's line, which might come from the fact that we consider new Function as
function anonymous() {
}
Updated•3 years ago
|
Comment 4•3 years ago
|
||
This looks like a duplicate of bug 1687166.
Comment 5•7 months ago
|
||
Comment 0 STR works fine now.
data:text/html,<script>/*** debugger is located at line 2* expect breakpoint stop at line 2* but firefox developer tool stop at line 4*/let f = new Function(
console.log(1);\ndebugger;\nconsole.log(3);\nconsole.log(4);\n);f.apply(this, []);</script>
Description
•