Closed
Bug 1206633
Opened 9 years ago
Closed 2 years ago
pretty print broke for...of statement
Categories
(DevTools :: Source Editor, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1674400
People
(Reporter: mozilla, Unassigned)
References
Details
Attachments
(1 file)
2.10 KB,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; rv:11.0) like Gecko
Steps to reproduce:
1. Load javascript source file with the following code :
for (let tab of tabs) { *\r\n* [...] *\r\n* }
2. Press CTRL+P
Actual results:
Code is formatted like this :
for (lettaboftabs) { [...]
The code won't work anymore
Expected results:
"let tab of tabs" should have not been touched
Updated•9 years ago
|
Component: Untriaged → Developer Tools: Scratchpad
Severity: normal → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 7 → All
Hardware: x86 → All
Summary: Scratchpad's indentation broke source code → pretty print broke for...of statement
Blocks: 965141
Component: Developer Tools: Scratchpad → Developer Tools: Source Editor
Comment 1•8 years ago
|
||
FWIW I see this in scratchpad but not in the debugger.
This patch solves the general problem where two name tokens weren't separated by a space in the output. The function isGetterOrSetter is no longer necessary because it's a special case of this problem.
Some minor cosmetic issues remain: this patch will output "for (let tab of[array])". Because "of" isn't a keyword, fixing that would require running a full parser or using imperfect heuristics such as turning "of" into a keyword in the whole argument.
Comment 3•7 years ago
|
||
Reiterating from https://bugzilla.mozilla.org/show_bug.cgi?id=1261971#c7,
this should go upstream to pretty-fast first.
https://github.com/mozilla/pretty-fast
Updated•6 years ago
|
Product: Firefox → DevTools
Comment 4•4 years ago
|
||
I submitted the issue upstream: https://github.com/mozilla/pretty-fast/issues/41
Updated•4 years ago
|
See Also: → https://github.com/mozilla/pretty-fast/issues/41
Comment 5•4 years ago
|
||
Comment 6•2 years ago
|
||
Just tested and this works properly.
Likely to have been fixed by Bug 1674400
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•