| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2006-2008 the V8 project authors. All rights reserved. | 3 # Copyright 2006-2008 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 Validate(lines, filename) | 294 Validate(lines, filename) |
| 295 lines = minifier.JSMinify(lines) | 295 lines = minifier.JSMinify(lines) |
| 296 data = ToCArray(lines) | 296 data = ToCArray(lines) |
| 297 id = (os.path.split(filename)[1])[:-3] | 297 id = (os.path.split(filename)[1])[:-3] |
| 298 if delay: id = id[:-6] | 298 if delay: id = id[:-6] |
| 299 if delay: | 299 if delay: |
| 300 delay_ids.append((id, len(lines))) | 300 delay_ids.append((id, len(lines))) |
| 301 else: | 301 else: |
| 302 ids.append((id, len(lines))) | 302 ids.append((id, len(lines))) |
| 303 source_lines.append(SOURCE_DECLARATION % { 'id': id, 'data': data }) | 303 source_lines.append(SOURCE_DECLARATION % { 'id': id, 'data': data }) |
| 304 source_lines_empty.append(SOURCE_DECLARATION % { 'id': id, 'data': 0 }) | 304 source_lines_empty.append(SOURCE_DECLARATION % { 'id': id, 'data': data }) |
| 305 | 305 |
| 306 # Build delay support functions | 306 # Build delay support functions |
| 307 get_index_cases = [ ] | 307 get_index_cases = [ ] |
| 308 get_script_source_cases = [ ] | 308 get_script_source_cases = [ ] |
| 309 get_script_name_cases = [ ] | 309 get_script_name_cases = [ ] |
| 310 | 310 |
| 311 i = 0 | 311 i = 0 |
| 312 for (id, length) in delay_ids: | 312 for (id, length) in delay_ids: |
| 313 native_name = "native %s.js" % id | 313 native_name = "native %s.js" % id |
| 314 get_index_cases.append(GET_DELAY_INDEX_CASE % { 'id': id, 'i': i }) | 314 get_index_cases.append(GET_DELAY_INDEX_CASE % { 'id': id, 'i': i }) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 367 |
| 368 def main(): | 368 def main(): |
| 369 natives = sys.argv[1] | 369 natives = sys.argv[1] |
| 370 natives_empty = sys.argv[2] | 370 natives_empty = sys.argv[2] |
| 371 type = sys.argv[3] | 371 type = sys.argv[3] |
| 372 source_files = sys.argv[4:] | 372 source_files = sys.argv[4:] |
| 373 JS2C(source_files, [natives, natives_empty], { 'TYPE': type }) | 373 JS2C(source_files, [natives, natives_empty], { 'TYPE': type }) |
| 374 | 374 |
| 375 if __name__ == "__main__": | 375 if __name__ == "__main__": |
| 376 main() | 376 main() |
| OLD | NEW |