pretty printing shouldn't lose comments

RESOLVED FIXED

Status

defect
P3
normal
RESOLVED FIXED
6 years ago
11 months ago

People

(Reporter: fitzgen, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Right now we use Reflect.jsm to parse our source, which doesn't add comment nodes to its AST, and so when we pass the AST to escodegen, we lose comments.

I see three ways to try and fix this, moving forward:

1. Add an option to Reflect.jsm to include comment nodes.

2. We will probably include the Acorn parser in devtools soon, which can optionally include comment nodes. We could use this instead of Reflect.jsm to parse code.

3. Use some post processing hueristics to attempt to place comments back into the code.

I am in favor of 2.
Depends on: 924466
Priority: -- → P3
Blocks: 913665
This doesn't need to block 913665.
No longer blocks: 913665
Fixed when we introduced https://github.com/mozilla/pretty-fast
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Updated

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