| 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 | 5 |
| 6 /** | 6 /** |
| 7 * If true, print a warning for each method that was resolved, but not | 7 * If true, print a warning for each method that was resolved, but not |
| 8 * compiled. | 8 * compiled. |
| 9 */ | 9 */ |
| 10 const bool REPORT_EXCESS_RESOLUTION = false; | 10 const bool REPORT_EXCESS_RESOLUTION = false; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 194 |
| 195 bool hasCrashed = false; | 195 bool hasCrashed = false; |
| 196 | 196 |
| 197 Compiler({this.tracer: const Tracer(), | 197 Compiler({this.tracer: const Tracer(), |
| 198 this.enableTypeAssertions: false, | 198 this.enableTypeAssertions: false, |
| 199 this.enableUserAssertions: false, | 199 this.enableUserAssertions: false, |
| 200 this.enableConcreteTypeInference: false, | 200 this.enableConcreteTypeInference: false, |
| 201 this.enableMinification: false, | 201 this.enableMinification: false, |
| 202 bool emitJavaScript: true, | 202 bool emitJavaScript: true, |
| 203 bool generateSourceMap: true, | 203 bool generateSourceMap: true, |
| 204 bool disableEval: false, |
| 204 List<String> strips: const []}) | 205 List<String> strips: const []}) |
| 205 : libraries = new Map<String, LibraryElement>(), | 206 : libraries = new Map<String, LibraryElement>(), |
| 206 progress = new Stopwatch() { | 207 progress = new Stopwatch() { |
| 207 progress.start(); | 208 progress.start(); |
| 208 world = new World(this); | 209 world = new World(this); |
| 209 scanner = new ScannerTask(this); | 210 scanner = new ScannerTask(this); |
| 210 dietParser = new DietParserTask(this); | 211 dietParser = new DietParserTask(this); |
| 211 parser = new ParserTask(this); | 212 parser = new ParserTask(this); |
| 212 patchParser = new PatchParserTask(this); | 213 patchParser = new PatchParserTask(this); |
| 213 libraryLoader = new LibraryLoaderTask(this); | 214 libraryLoader = new LibraryLoaderTask(this); |
| 214 validator = new TreeValidatorTask(this); | 215 validator = new TreeValidatorTask(this); |
| 215 resolver = new ResolverTask(this); | 216 resolver = new ResolverTask(this); |
| 216 closureToClassMapper = new closureMapping.ClosureTask(this); | 217 closureToClassMapper = new closureMapping.ClosureTask(this); |
| 217 checker = new TypeCheckerTask(this); | 218 checker = new TypeCheckerTask(this); |
| 218 typesTask = new ti.TypesTask(this, enableConcreteTypeInference); | 219 typesTask = new ti.TypesTask(this, enableConcreteTypeInference); |
| 219 backend = emitJavaScript ? | 220 backend = emitJavaScript ? |
| 220 new js_backend.JavaScriptBackend(this, generateSourceMap) : | 221 new js_backend.JavaScriptBackend(this, generateSourceMap, disableEval) : |
| 221 new dart_backend.DartBackend(this, strips); | 222 new dart_backend.DartBackend(this, strips); |
| 222 constantHandler = new ConstantHandler(this, backend.constantSystem); | 223 constantHandler = new ConstantHandler(this, backend.constantSystem); |
| 223 enqueuer = new EnqueueTask(this); | 224 enqueuer = new EnqueueTask(this); |
| 224 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper, | 225 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper, |
| 225 checker, typesTask, constantHandler, enqueuer]; | 226 checker, typesTask, constantHandler, enqueuer]; |
| 226 tasks.addAll(backend.tasks); | 227 tasks.addAll(backend.tasks); |
| 227 } | 228 } |
| 228 | 229 |
| 229 Universe get resolverWorld => enqueuer.resolution.universe; | 230 Universe get resolverWorld => enqueuer.resolution.universe; |
| 230 Universe get codegenWorld => enqueuer.codegen.universe; | 231 Universe get codegenWorld => enqueuer.codegen.universe; |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 // TODO(johnniwinther): Use [spannable] and [message] to provide better | 856 // TODO(johnniwinther): Use [spannable] and [message] to provide better |
| 856 // information on assertion errors. | 857 // information on assertion errors. |
| 857 if (condition is Function){ | 858 if (condition is Function){ |
| 858 condition = condition(); | 859 condition = condition(); |
| 859 } | 860 } |
| 860 if (!condition && message != null) { | 861 if (!condition && message != null) { |
| 861 print('assertion failed: $message'); | 862 print('assertion failed: $message'); |
| 862 } | 863 } |
| 863 return spannable != null && condition; | 864 return spannable != null && condition; |
| 864 } | 865 } |
| OLD | NEW |