| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2012 the V8 project authors. All rights reserved. | 3 # Copyright 2012 the V8 project authors. All rights reserved. |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | 29 |
| 30 # This is a utility for converting JavaScript source code into C-style | 30 # This is a utility for converting JavaScript source code into C-style |
| 31 # char arrays. It is used for embedded JavaScript code in the V8 | 31 # char arrays. It is used for embedded JavaScript code in the V8 |
| 32 # library. | 32 # library. |
| 33 | 33 |
| 34 import os, re, sys, string | 34 import os, re |
| 35 import optparse | 35 import optparse |
| 36 import jsmin | 36 import jsmin |
| 37 import bz2 | |
| 38 import textwrap | 37 import textwrap |
| 39 | 38 |
| 40 | 39 |
| 41 class Error(Exception): | 40 class Error(Exception): |
| 42 def __init__(self, msg): | 41 def __init__(self, msg): |
| 43 Exception.__init__(self, msg) | 42 Exception.__init__(self, msg) |
| 44 | 43 |
| 45 | 44 |
| 46 def ToCArray(byte_sequence): | 45 def ToCArray(byte_sequence): |
| 47 result = [] | 46 result = [] |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 JS2C(args[2:], | 595 JS2C(args[2:], |
| 597 args[0], | 596 args[0], |
| 598 args[1], | 597 args[1], |
| 599 options.raw, | 598 options.raw, |
| 600 options.startup_blob, | 599 options.startup_blob, |
| 601 options.js) | 600 options.js) |
| 602 | 601 |
| 603 | 602 |
| 604 if __name__ == "__main__": | 603 if __name__ == "__main__": |
| 605 main() | 604 main() |
| OLD | NEW |