Closed Bug 921163 Opened 11 years ago Closed 10 years ago

pretty printing shouldn't lose comments

Categories

(DevTools :: Debugger, defect, P3)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: fitzgen, Unassigned)

References

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
Closed: 10 years ago
Resolution: --- → FIXED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.