| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 * Should be called exactly once to setup singleton world. | 9 * Should be called exactly once to setup singleton world. |
| 10 * Can use world.reset() to reinitialize. | 10 * Can use world.reset() to reinitialize. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 /** Internal map to track name conflicts in the generated javascript. */ | 77 /** Internal map to track name conflicts in the generated javascript. */ |
| 78 Map<String, Named> _topNames; | 78 Map<String, Named> _topNames; |
| 79 | 79 |
| 80 Map<String, MemberSet> _members; | 80 Map<String, MemberSet> _members; |
| 81 | 81 |
| 82 int errors = 0, warnings = 0; | 82 int errors = 0, warnings = 0; |
| 83 int dartBytesRead = 0, jsBytesWritten = 0; | 83 int dartBytesRead = 0, jsBytesWritten = 0; |
| 84 bool seenFatal = false; | 84 bool seenFatal = false; |
| 85 | 85 |
| 86 // Special types to Dart. | 86 // Special types to Dart. |
| 87 DefinedType varType; | 87 Type varType; |
| 88 // TODO(jimhug): Is this ever not === varType? | 88 // TODO(jimhug): Is this ever not === varType? |
| 89 DefinedType dynamicType; | 89 Type dynamicType; |
| 90 | 90 |
| 91 DefinedType voidType; | 91 Type voidType; |
| 92 | 92 |
| 93 DefinedType objectType; | 93 Type objectType; |
| 94 DefinedType numType; | 94 Type numType; |
| 95 DefinedType intType; | 95 Type intType; |
| 96 DefinedType doubleType; | 96 Type doubleType; |
| 97 DefinedType boolType; | 97 Type boolType; |
| 98 DefinedType stringType; | 98 Type stringType; |
| 99 DefinedType listType; | 99 Type listType; |
| 100 DefinedType mapType; | 100 Type mapType; |
| 101 DefinedType functionType; | 101 Type functionType; |
| 102 | 102 |
| 103 World(this.files) | 103 World(this.files) |
| 104 : libraries = {}, _todo = [], _members = {}, _topNames = {}, | 104 : libraries = {}, _todo = [], _members = {}, _topNames = {}, |
| 105 // TODO(jmesserly): these two types don't actually back our Date and | 105 // TODO(jmesserly): these two types don't actually back our Date and |
| 106 // RegExp yet, so we need to add them manually. | 106 // RegExp yet, so we need to add them manually. |
| 107 reader = new LibraryReader() { | 107 reader = new LibraryReader() { |
| 108 } | 108 } |
| 109 | 109 |
| 110 void reset() { | 110 void reset() { |
| 111 // TODO(jimhug): Use a smaller hammer in the future. | 111 // TODO(jimhug): Use a smaller hammer in the future. |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 | 432 |
| 433 withTiming(String name, f()) { | 433 withTiming(String name, f()) { |
| 434 final sw = new StopWatch(); | 434 final sw = new StopWatch(); |
| 435 sw.start(); | 435 sw.start(); |
| 436 var result = f(); | 436 var result = f(); |
| 437 sw.stop(); | 437 sw.stop(); |
| 438 info('$name in ${sw.elapsedInMs()}msec'); | 438 info('$name in ${sw.elapsedInMs()}msec'); |
| 439 return result; | 439 return result; |
| 440 } | 440 } |
| 441 } | 441 } |
| OLD | NEW |