Changeset 163906 in webkit


Ignore:
Timestamp:
Feb 11, 2014 1:36:06 PM (10 years ago)
Author:
jer.noble@apple.com
Message:

Run UserAgentScripts through jsmin rather than the css preprocessor
https://bugs.webkit.org/show_bug.cgi?id=127559

Reviewed by Tim Horton.

User Agent JavaScript files were being run through the c++ preprocessor to strip out
comments (and presumably to allow #if ENABLE macros, though that feature is entirely
unused). This had the side effect of removing important whitespace, namely newlines where
there would normally be an implicit semicolon.

Instead, .js files will now be run through the jsmin minifier, used by the inspector.
Jsmin will also strip comments and whitespace, but in a syntactically aware way which will
keep newlines when their presence adds an implied semicolon.

  • DerivedSources.make:
  • Scripts/make-js-file-arrays.py: Added.

(stringifyCodepoint):
(chunk):
(main):

Location:
trunk/Source/WebCore
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r163905 r163906  
     12014-01-24  Jer Noble  <jer.noble@apple.com>
     2
     3        Run UserAgentScripts through jsmin rather than the css preprocessor
     4        https://bugs.webkit.org/show_bug.cgi?id=127559
     5
     6        Reviewed by Tim Horton.
     7
     8        User Agent JavaScript files were being run through the c++ preprocessor to strip out
     9        comments (and presumably to allow #if ENABLE macros, though that feature is entirely
     10        unused). This had the side effect of removing important whitespace, namely newlines where
     11        there would normally be an implicit semicolon.
     12
     13        Instead, .js files will now be run through the jsmin minifier, used by the inspector.
     14        Jsmin will also strip comments and whitespace, but in a syntactically aware way which will
     15        keep newlines when their presence adds an implied semicolon.
     16
     17        * DerivedSources.make:
     18        * Scripts/make-js-file-arrays.py: Added.
     19        (stringifyCodepoint):
     20        (chunk):
     21        (main):
     22
    1232014-02-11  Andy Estes  <aestes@apple.com>
    224
  • trunk/Source/WebCore/DerivedSources.make

    r163649 r163906  
    893893endif
    894894
    895 UserAgentScripts.h : css/make-css-file-arrays.pl bindings/scripts/preprocessor.pm $(USER_AGENT_SCRIPTS) $(PLATFORM_FEATURE_DEFINES)
    896         perl -I$(WebCore)/bindings/scripts $< --defines "$(FEATURE_DEFINES)" $@ UserAgentScriptsData.cpp $(USER_AGENT_SCRIPTS)
     895UserAgentScripts.h : Scripts/make-js-file-arrays.py $(USER_AGENT_SCRIPTS)
     896        PYTHONPATH=$(InspectorScripts) python $< $@ UserAgentScriptsData.cpp $(USER_AGENT_SCRIPTS)
    897897
    898898# --------
Note: See TracChangeset for help on using the changeset viewer.