Closed Bug 938203 Opened 11 years ago Closed 1 year ago

[meta] [prettify] support pretty printing ES6

Categories

(DevTools :: General, defect)

28 Branch
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: lp_, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: meta)

In Scratchpad of current Nightly, given following codes,

  foo = (x) => x+1;
  let a = [1,2,3];
  for (x of a) console.log(x);

when "Pretty Print", these codes get wrong results as this:

  foo = (x) = > x + 1;
  leta = [
    1,
    2,
    3
  ];
  for (xofa) console.log(x);

the ArrowExpression "=>" becomes "= >", with a space in the middle.
"let a" becomes "leta", and "(x of a)" becomes "(xofa)".

This means that currently the "Pretty Print" in Scratchpad cannot correctly print chrome://ping/content/xbl/scratchpad.js itself.
(wrong url)
This means that currently the "Pretty Print" in Scratchpad cannot correctly print chrome://browser/content/devtools/scratchpad.js itself.
We recently switched to using acorn [1] for our parser, which only supports ES5. We hope to either add ES6 support or that the author will add ES6 support in the future, but there's a lot of new syntax in ES6.
OS: Windows XP → All
Hardware: x86 → All
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Pretty Print give wrong result for some syntax (ArrowExpression, ForOfStatement, LetStatement, etc) → [prettify] support pretty printing ES6
Blocks: 1006524
Summary: [prettify] support pretty printing ES6 → [meta] [prettify] support pretty printing ES6
Depends on: 1120871
Blocks: 1120871
No longer depends on: 1120871
No longer blocks: 1120871
Depends on: 1120871
Depends on: 1213202
Acorn now supports ES6. This should be fixable.
Depends on: 1302058
Problem still exist. Same issue with "Pretty Print" scratchpad in FF57.
Product: Firefox → DevTools
Severity: normal → S3

I think we handled the cases that were problematic and it doesn't make sense to keep this meta around as we have Bug 1070862

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.