| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 bool compilationFailed = false; | 184 bool compilationFailed = false; |
| 185 | 185 |
| 186 bool hasCrashed = false; | 186 bool hasCrashed = false; |
| 187 | 187 |
| 188 Compiler([this.tracer = const Tracer(), | 188 Compiler([this.tracer = const Tracer(), |
| 189 this.enableTypeAssertions = false, | 189 this.enableTypeAssertions = false, |
| 190 this.enableUserAssertions = false, | 190 this.enableUserAssertions = false, |
| 191 this.enableMinification = false, | 191 this.enableMinification = false, |
| 192 bool emitJavaScript = true, | 192 bool emitJavaScript = true, |
| 193 bool generateSourceMap = true, | 193 bool generateSourceMap = true, |
| 194 bool forceCutDeclarationTypes = false]) | 194 List<String> strips = const []]) |
| 195 : libraries = new Map<String, LibraryElement>(), | 195 : libraries = new Map<String, LibraryElement>(), |
| 196 progress = new Stopwatch() { | 196 progress = new Stopwatch() { |
| 197 progress.start(); | 197 progress.start(); |
| 198 world = new World(this); | 198 world = new World(this); |
| 199 scanner = new ScannerTask(this); | 199 scanner = new ScannerTask(this); |
| 200 dietParser = new DietParserTask(this); | 200 dietParser = new DietParserTask(this); |
| 201 parser = new ParserTask(this); | 201 parser = new ParserTask(this); |
| 202 patchParser = new PatchParserTask(this); | 202 patchParser = new PatchParserTask(this); |
| 203 validator = new TreeValidatorTask(this); | 203 validator = new TreeValidatorTask(this); |
| 204 resolver = new ResolverTask(this); | 204 resolver = new ResolverTask(this); |
| 205 closureToClassMapper = new closureMapping.ClosureTask(this); | 205 closureToClassMapper = new closureMapping.ClosureTask(this); |
| 206 checker = new TypeCheckerTask(this); | 206 checker = new TypeCheckerTask(this); |
| 207 typesTask = new ti.TypesTask(this); | 207 typesTask = new ti.TypesTask(this); |
| 208 backend = emitJavaScript ? | 208 backend = emitJavaScript ? |
| 209 new js_backend.JavaScriptBackend(this, generateSourceMap) : | 209 new js_backend.JavaScriptBackend(this, generateSourceMap) : |
| 210 new dart_backend.DartBackend(this, forceCutDeclarationTypes); | 210 new dart_backend.DartBackend(this, strips); |
| 211 constantHandler = new ConstantHandler(this, backend.constantSystem); | 211 constantHandler = new ConstantHandler(this, backend.constantSystem); |
| 212 enqueuer = new EnqueueTask(this); | 212 enqueuer = new EnqueueTask(this); |
| 213 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper, | 213 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper, |
| 214 checker, typesTask, constantHandler, enqueuer]; | 214 checker, typesTask, constantHandler, enqueuer]; |
| 215 tasks.addAll(backend.tasks); | 215 tasks.addAll(backend.tasks); |
| 216 } | 216 } |
| 217 | 217 |
| 218 Universe get resolverWorld => enqueuer.resolution.universe; | 218 Universe get resolverWorld => enqueuer.resolution.universe; |
| 219 Universe get codegenWorld => enqueuer.codegen.universe; | 219 Universe get codegenWorld => enqueuer.codegen.universe; |
| 220 | 220 |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 * information in the generated error message. | 948 * information in the generated error message. |
| 949 */ | 949 */ |
| 950 bool invariant(Spannable spannable, var condition, {String message: null}) { | 950 bool invariant(Spannable spannable, var condition, {String message: null}) { |
| 951 // TODO(johnniwinther): Use [spannable] and [message] to provide better | 951 // TODO(johnniwinther): Use [spannable] and [message] to provide better |
| 952 // information on assertion errors. | 952 // information on assertion errors. |
| 953 if (condition is Function){ | 953 if (condition is Function){ |
| 954 condition = condition(); | 954 condition = condition(); |
| 955 } | 955 } |
| 956 return spannable != null && condition; | 956 return spannable != null && condition; |
| 957 } | 957 } |
| OLD | NEW |