Bug 134007

Summary: Web Inspector: JS PrettyPrinting unary - and + issues
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 412.x   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
timothy: review+, buildbot: commit-queue-
[PATCH] For Landing
buildbot: commit-queue-
Archive of layout-test-results from ews117 for mac-yosemite
none
Archive of layout-test-results from ews114 for mac-yosemite none

Description Joseph Pecoraro 2014-06-17 17:02:56 PDT
TEST:

    f(-1);
    x = -1 + 1;
    f(+1);
    x = +1 + 1;

OUTPUT:

    f( - 1);
    x = - 1 + 1;
    f( + 1);
    x = + 1 + 1;

EXPECTED:

    f(-1);
    x = -1 + 1;
    f(+1);
    x = +1 + 1;
Comment 1 Joseph Pecoraro 2014-06-17 17:04:15 PDT
In fact, this produces even worse results:

    f(-1);
    x=-1+1;
    f(+1);
    x=+1+1;

Namely that "=-" and "=+" are treated as operators. That is CodeMirror's tokenization, maybe that should be improved.
Comment 2 Radar WebKit Bug Importer 2014-06-17 17:04:49 PDT
<rdar://problem/17351953>
Comment 3 Radar WebKit Bug Importer 2014-06-17 17:05:23 PDT
<rdar://problem/17351983>
Comment 4 Joseph Pecoraro 2016-02-03 16:04:22 PST
*** Bug 153830 has been marked as a duplicate of this bug. ***
Comment 5 Joseph Pecoraro 2016-02-03 16:16:04 PST
Created attachment 270606 [details]
[PATCH] Proposed Fix
Comment 6 Joseph Pecoraro 2016-02-03 16:18:15 PST
This also fixed an issue with '%' (modulo) operator and ternary in array / property index '[' ']' scopes.
Comment 7 Joseph Pecoraro 2016-02-03 16:23:48 PST
Created attachment 270608 [details]
[PATCH] For Landing
Comment 8 WebKit Commit Bot 2016-02-03 16:56:27 PST
Comment on attachment 270608 [details]
[PATCH] For Landing

Clearing flags on attachment: 270608

Committed r196098: <http://trac.webkit.org/changeset/196098>
Comment 9 Build Bot 2016-02-03 17:12:06 PST
Comment on attachment 270606 [details]
[PATCH] Proposed Fix

Attachment 270606 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/779118

New failing tests:
imported/w3c/web-platform-tests/streams-api/readable-streams/garbage-collection-2.html
Comment 10 Build Bot 2016-02-03 17:12:08 PST
Created attachment 270613 [details]
Archive of layout-test-results from ews117 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 11 Build Bot 2016-02-03 17:17:28 PST
Comment on attachment 270608 [details]
[PATCH] For Landing

Attachment 270608 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/779144

New failing tests:
imported/w3c/web-platform-tests/streams-api/readable-streams/garbage-collection-2.html
Comment 12 Build Bot 2016-02-03 17:17:31 PST
Created attachment 270615 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5