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.
<rdar://problem/15235823>
Pull request submitted to the CodeMirror repository: https://github.com/lvidacs/CodeMirror/commit/1cb45c87c70629e6cb5899403e07b2ab39354dca
The patch landed in CodeMirror https://github.com/marijnh/CodeMirror/commit/39804ada3d6d14da5e0f237fa5904a5e0aaa4489
Sweet! We just need to update CodeMirror then.
Thanks for fixing this!
Created attachment 218053 [details] Patch
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.
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.
Created attachment 218969 [details] Patch
Patch updated accordingly; codemirror.js files in WebInspectorUI/Tools/PrettyPrinting/ and in WebInspectorUI/UserInterface/External/CodeMirror/ now differ.
(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.
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.
Created attachment 218990 [details] Patch
Sorry, I updated the patch with identical codemirror.js in both places.
Comment on attachment 218990 [details] Patch Clearing flags on attachment: 218990 Committed r160500: <http://trac.webkit.org/changeset/160500>
All reviewed patches have been landed. Closing bug.