Support ES6 syntax for prettyprinting

NEW
Unassigned

Status

DevTools
Debugger
P3
normal
5 years ago
a month ago

People

(Reporter: vporof, Unassigned)

Tracking

(Depends on: 2 bugs, Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
for (let foo of bar) {}

Pretty prints to:

for (letfooofbar) {
}

Alternatively, if using var:

for (var fooofbar) {
}
Expected as it doesn't do ES6.

Would be nice if we could disable auto pretty printing only for chrome debugging.
Summary: Pretty printer can't handle for..of loops → [prettify] Pretty printer can't handle for..of loops
Priority: -- → P3

Updated

4 years ago
Blocks: 1070862

Updated

4 years ago
Summary: [prettify] Pretty printer can't handle for..of loops → Support ES6 syntax for prettyprinting

Updated

4 years ago
Duplicate of this bug: 1102799
We can pass `{ ecmaVersion: 6 }` as an option to the tokenizer and get this functionality (most likely would want to bump to the latest version of acorn to get more features supported, but I believe it should work with the current version).
There's a particular case of es6 prettyprining that seems to be fixed by passing the option to acorn in Bug 951622
Depends on: 951622
...However, it doesn't fix the 
for (let foo of bar) -> for (let fooofbar) thing

Updated

2 years ago
Depends on: 1206633
Bug 938203 seems to be a similar meta bug for the same issue, but with different bugs under it.  Someone may want to fold them together if they work on this issue.
See Also: → bug 938203

Comment 7

10 months ago
Looks like duplicate of bug 938203...

Updated

a month ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.