If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Syntax of all functions following "switch" is pushed to the left (broken) after pretty-print




Developer Tools: Debugger
2 years ago
a day ago


(Reporter: arni2033, Unassigned, NeedInfo)


(Blocks: 1 bug, {regression})

32 Branch
Dependency tree / graph

Firefox Tracking Flags

(firefox47 wontfix, firefox48 wontfix, firefox49 fix-optional, firefox50 fix-optional)



(1 attachment)



2 years ago
>>>   My Info:   Win7_64, Nightly 48, 32bit, ID 20160403030243
1. Pretty-print the following line (without ">")

AR:  Syntax of all functions following "switch" is pushed to the left
ER:  Syntax should be displayed in a normal way

If you're not convinced, add ";if(0){if(0){if(0){if(0){3}}}}" to the line in Step 1 and try again.

This is regression from bug 1020587 (bug 1018586 helped to track it down). Regression range:
> https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=51b428be6213&tochange=c8288d0c7a15


2 years ago
Summary: Syntax of all functions following "switch" is pushed to the left (broken) → Syntax of all functions following "switch" is pushed to the left (broken) after pretty-print
More pretty printing woes :-(
Priority: -- → P3

Comment 2

a year ago
I haven't tested, but I think this bug might be caused by this[1] line. It should reference the ttl variable, not token, because that's the one which contains the string representation of the token.

I've needinfo'd the author (anaran) and reviewer (fitzgen) of this code.

More info:

The offending line in mozilla-central[2]
pretty-fast commit where this bug was introduced[3]
github pull request[4]

[1] https://github.com/mozilla/pretty-fast/blob/master/pretty-fast.js#L842 
[2] https://hg.mozilla.org/mozilla-central/file/tip/devtools/shared/pretty-fast/pretty-fast.js#l842
[3] https://github.com/mozilla/pretty-fast/commit/76e29cd79f07d0966bd0e06a71eafb8c77556a2d
[4] https://github.com/mozilla/pretty-fast/pull/7
Flags: needinfo?(nfitzgerald)
Flags: needinfo?(adrian.aichner)
Sounds like that might be correct, but I don't have time to dig in.
Flags: needinfo?(nfitzgerald)

Comment 4

a year ago
Would it help if I submitted a pull request on github with a test?

For the record, it took me less than 5 minutes of looking at the source to notice this, having absolutely no prior knowledge of the code.
Yes, if you have PRs or patches, I can review.
status-firefox48: affected → wontfix


a year ago
status-firefox49: --- → affected
status-firefox50: --- → affected
Version: Trunk → 32 Branch
status-firefox47: --- → wontfix
status-firefox49: affected → fix-optional
status-firefox50: affected → fix-optional


7 months ago
Blocks: 1070862

Comment 6

2 days ago
Created attachment 8911137 [details] [diff] [review]
Fixes bug and adds test

Ari's hypothesis appears to be correct. See patch.
Thanks for the patch - but this module is maintained on github.
So, the way to fix it is first submit a PR to the github project
Then, get a new release of pretty-fast, and finally land the new bundle in M-C.
You need to log in before you can comment on or make changes to this bug.