• vogelheim@chromium.org's avatar
    Add support for --raw and --omit to js2c. · b88068ff
    vogelheim@chromium.org authored
      --raw writes the raw source data to a separate file
      --omit allows omitting the source data from the generated files.
    
    The intention is (future) support for having the embedder optionally
    store the source data 'blob' and handling it to V8::Initialize, with
    the goal of reducing the binary size of V8.
    
    The patch also contains numerous unrelated changes/refactorings in the hope of increasing maintainability. Let me know whether you agree. In particular:
    - Remove some unused code.
    - Do not overwrite Python built-ins (e.g. the type() function)
    - Do not use a string as exception object (no longer supported in python 2.7)
    - Add command line argument handling + help text.
    - Split logic into:
      - PrepareSources - which reads + preprocesses the source files
      - BuildMetadata - which takes the prepared sources and generates the data the code template needs.
    
    BUG=355539
    LOG=N
    R=jochen@chromium.org
    
    Review URL: https://codereview.chromium.org/225723002
    
    git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20657 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
    b88068ff
js2c.py 15.5 KB