Can not set breakpoint if JS contains ES6 function export
Reported by
lbrac...@gmail.com,
Jul 25 2016
|
||||||||
Issue description
Chrome Version : 51.0.2704.103
OS Version: OS X 10.11.4
What steps will reproduce the problem?
1. Create JS file containing ES6 function export
```
// Export example
export function demo() {
return true;
}
```
2. Open Inspector -> Source -> Open that source file.
3. Set breakpoint somewhere
What is the expected result?
Breakpoint positioned on exact line it was placed.
What happens instead of that?
Breakpoint is miss placed.
If you export function as const it will work as expected.
```
// Works normally
export const demo = function () {
return true;
}
```
UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
,
Jul 27 2016
Moving this nonessential bug to the next milestone. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 27 2016
,
Jul 29 2016
Hi, here is screen record of the problem.
It is simple to reproduce.
Also if you change export (you'll see in video) to
export const example = function () {...}
You are going to be able to set breakpoint.
Hope it helps.
,
Jul 30 2016
,
Aug 1 2016
I can't replicate the issue. Are you using any ES6 compilation tools like Babel?
,
Aug 1 2016
"export const ..." is a syntax error in Chrome currently. As #6 asks, how are you loading this script into Chrome?
,
Aug 1 2016
This occurs while debugging React Native. Code should be transpiled with Babel but I am really not sure what happens under the hood. I am also not sure how RN communicates with chrome debugger. I can confirm that his happens to other as well. Do you have any hunch what may be the cause for this misinterpretation?
,
Aug 2 2016
Does it use source map to map pre-Babel to post-Babel code? Maybe the source map is wrong around the export?
,
Aug 16 2016
Thank you for providing more feedback. Adding requester "durga.behera@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Aug 18 2016
Still needs feedback (answer to yangguo's #9)
,
Aug 30 2016
,
Sep 30 2016
Still needs user feedback. Marked as WontFix for now. Thank you for reporting and participating, feel free to reopen it. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by durga.behera@chromium.org
, Jul 27 2016Components: Platform>DevTools>JavaScript
Labels: Needs-Feedback M-53