| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** The one true [World]. */ | 5 /** The one true [World]. */ |
| 6 World world; | 6 World world; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Experimental phase to enable await, only set when using the | 9 * Experimental phase to enable await, only set when using the |
| 10 * await/awaitc.dart entrypoint. | 10 * await/awaitc.dart entrypoint. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 FileSystem files; | 98 FileSystem files; |
| 99 final LibraryReader reader; | 99 final LibraryReader reader; |
| 100 | 100 |
| 101 Map<String, Library> libraries; | 101 Map<String, Library> libraries; |
| 102 Library corelib; | 102 Library corelib; |
| 103 Library coreimpl; | 103 Library coreimpl; |
| 104 | 104 |
| 105 // TODO(jmesserly): we shouldn't be special casing DOM anywhere. | 105 // TODO(jmesserly): we shouldn't be special casing DOM anywhere. |
| 106 Library dom; | 106 Library dom; |
| 107 Library html; |
| 107 Library isolatelib; | 108 Library isolatelib; |
| 108 | 109 |
| 109 List<Library> _todo; | 110 List<Library> _todo; |
| 110 | 111 |
| 111 /** Internal map to track name conflicts in the generated javascript. */ | 112 /** Internal map to track name conflicts in the generated javascript. */ |
| 112 Map<String, Element> _topNames; | 113 Map<String, Element> _topNames; |
| 113 | 114 |
| 114 /** | 115 /** |
| 115 * Internal set of member names that should be avoided because they are known | 116 * Internal set of member names that should be avoided because they are known |
| 116 * to exist on various objects. | 117 * to exist on various objects. |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 info('read library ${filename}'); | 466 info('read library ${filename}'); |
| 466 if (!library.isCore && | 467 if (!library.isCore && |
| 467 !library.imports.some((li) => li.library.isCore)) { | 468 !library.imports.some((li) => li.library.isCore)) { |
| 468 library.imports.add(new LibraryImport(corelib)); | 469 library.imports.add(new LibraryImport(corelib)); |
| 469 } | 470 } |
| 470 libraries[filename] = library; | 471 libraries[filename] = library; |
| 471 _todo.add(library); | 472 _todo.add(library); |
| 472 | 473 |
| 473 if (filename == 'dart:dom') { | 474 if (filename == 'dart:dom') { |
| 474 dom = library; | 475 dom = library; |
| 476 } else if (filename == 'dart:html') { |
| 477 html = library; |
| 475 } else if (filename == 'dart:isolate') { | 478 } else if (filename == 'dart:isolate') { |
| 476 isolatelib = library; | 479 isolatelib = library; |
| 477 } | 480 } |
| 478 } | 481 } |
| 479 return library; | 482 return library; |
| 480 } | 483 } |
| 481 | 484 |
| 482 process() { | 485 process() { |
| 483 while (_todo.length > 0) { | 486 while (_todo.length > 0) { |
| 484 final todo = _todo; | 487 final todo = _todo; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 | 720 |
| 718 withTiming(String name, f()) { | 721 withTiming(String name, f()) { |
| 719 final sw = new Stopwatch(); | 722 final sw = new Stopwatch(); |
| 720 sw.start(); | 723 sw.start(); |
| 721 var result = f(); | 724 var result = f(); |
| 722 sw.stop(); | 725 sw.stop(); |
| 723 info('$name in ${sw.elapsedInMs()}msec'); | 726 info('$name in ${sw.elapsedInMs()}msec'); |
| 724 return result; | 727 return result; |
| 725 } | 728 } |
| 726 } | 729 } |
| OLD | NEW |