Bug 134003 - Web Inspector: JS PrettyPrinting issues with ternary statement
Summary: Web Inspector: JS PrettyPrinting issues with ternary statement
Status: RESOLVED DUPLICATE of bug 156178
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 412.x
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-06-17 16:34 PDT by Joseph Pecoraro
Modified: 2016-04-04 14:48 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2014-06-17 16:34:14 PDT
Ternary statement in a var declaration or global scope does not pretty print as expected. There should be a space before the ":" but there is not:

TEST:

    var x=true?a:b; // wrong
    var x=(true?a:b);
    x=true?a:b;
    function() {var x=true?a:b;} // wrong

OUTPUTS:

    var x = true ? a: b; // wrong
    var x = (true ? a : b);
    x = true ? a : b;
    function() {
        var x = true ? a: b;
    }
    // wrong

NOTES:

- The first wrong case the previous is "block", a.k.a. global scope here.
- The second wrong case the pervious is "vardef".
- I would have expected both of these to have previous be vardef.
Comment 1 Radar WebKit Bug Importer 2014-06-17 16:35:19 PDT
<rdar://problem/17351457>
Comment 2 Joseph Pecoraro 2016-04-04 14:48:47 PDT
This will be fixed by Bug 156178.

*** This bug has been marked as a duplicate of bug 156178 ***