Bug 122868

Summary: Web Inspector: ES6: JavaScript syntax highlighting and recognition of for..of
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, lvidacs.u-szeged, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Joseph Pecoraro
Reported 2013-10-15 15:27:26 PDT
JSC now supports for..of. We should syntax highlight it like for..in: Compare these in the JS Console: js> for (var x in []) {} js> for (var x of []) {} NOTE: Most likely CodeMirror JavaScript ES6 update.
Attachments
Patch (163.66 KB, patch)
2013-11-29 04:43 PST, Laszlo Vidacs
no flags
Patch (163.17 KB, patch)
2013-12-11 08:47 PST, Laszlo Vidacs
no flags
Patch (162.68 KB, patch)
2013-12-11 11:50 PST, Laszlo Vidacs
no flags
Radar WebKit Bug Importer
Comment 1 2013-10-15 15:27:42 PDT
Laszlo Vidacs
Comment 2 2013-11-14 02:19:01 PST
Laszlo Vidacs
Comment 3 2013-11-14 02:36:59 PST
Timothy Hatcher
Comment 4 2013-11-14 09:20:58 PST
Sweet! We just need to update CodeMirror then.
Timothy Hatcher
Comment 5 2013-11-14 09:21:32 PST
Thanks for fixing this!
Laszlo Vidacs
Comment 6 2013-11-29 04:43:26 PST
Laszlo Vidacs
Comment 7 2013-11-29 04:45:46 PST
CodeMirror release 3.20 contains javascript ES6 updates, among others the fix for this bug. Patch created according to the commnet in https://bugs.webkit.org/show_bug.cgi?id=120165 however not fully tested.
Timothy Hatcher
Comment 8 2013-12-02 13:07:08 PST
Comment on attachment 218053 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=218053&action=review > Source/WebInspectorUI/Tools/PrettyPrinting/codemirror.js:5570 > - var result = /\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(str.slice(i - 1, i + 1)); > - return result; > + return /\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(str.slice(i - 1, i + 1)); This change breaks the jsmin.py script. It needs reverted. This is a local change to CodeMirror we have until we fix it. Testing copy-user-interface-resources.sh with COMBINE_INSPECTOR_RESOURCES = YES will show what I mean. > Source/WebInspectorUI/Tools/PrettyPrinting/codemirror.js:5583 > - var result = /[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|â¦[\w~`@#$%\^&*(_=+{[><]/.test(str.slice(i - 1, i + 1)); > - return result; > + return /[~!#%&*)=+}\]\\|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|â¦[\w~`@#$%\^&*(_=+{[><]/.test(str.slice(i - 1, i + 1)); Ditto.
Laszlo Vidacs
Comment 9 2013-12-11 08:47:50 PST
Laszlo Vidacs
Comment 10 2013-12-11 08:52:54 PST
Patch updated accordingly; codemirror.js files in WebInspectorUI/Tools/PrettyPrinting/ and in WebInspectorUI/UserInterface/External/CodeMirror/ now differ.
Joseph Pecoraro
Comment 11 2013-12-11 10:15:07 PST
(In reply to comment #10) > Patch updated accordingly; codemirror.js files in WebInspectorUI/Tools/PrettyPrinting/ and in WebInspectorUI/UserInterface/External/CodeMirror/ now differ. No reason for these files to differ. PrettyPrinting should just be a copy of UserInterface/External/CodeMirror. It is nice to have them separate for development, but identical if you run pretty printing tests.
Timothy Hatcher
Comment 12 2013-12-11 10:16:33 PST
Comment on attachment 218969 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=218969&action=review > Source/WebInspectorUI/UserInterface/External/CodeMirror/codemirror.js:5570 > - var result = /\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(str.slice(i - 1, i + 1)); > - return result; > + return /\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(str.slice(i - 1, i + 1)); Sorry for the confusion. My comment wasn't meant for the PrettyPrinting copy. It was meant for the main codemirror.js. The version in UserInterface is the one we use jsmin.js on, but both copies in our tree should be the same. > Source/WebInspectorUI/UserInterface/External/CodeMirror/codemirror.js:5583 > - var result = /[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|â¦[\w~`@#$%\^&*(_=+{[><]/.test(str.slice(i - 1, i + 1)); > - return result; > + return /[~!#%&*)=+}\]\\|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|â¦[\w~`@#$%\^&*(_=+{[><]/.test(str.slice(i - 1, i + 1)); Ditto.
Laszlo Vidacs
Comment 13 2013-12-11 11:50:52 PST
Laszlo Vidacs
Comment 14 2013-12-11 11:54:28 PST
Sorry, I updated the patch with identical codemirror.js in both places.
WebKit Commit Bot
Comment 15 2013-12-12 11:49:42 PST
Comment on attachment 218990 [details] Patch Clearing flags on attachment: 218990 Committed r160500: <http://trac.webkit.org/changeset/160500>
WebKit Commit Bot
Comment 16 2013-12-12 11:49:44 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.