| 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 #library('leg_apiimpl'); | 5 #library('leg_apiimpl'); |
| 6 | 6 |
| 7 #import('dart:uri'); | 7 #import('dart:uri'); |
| 8 | 8 |
| 9 #import('../compiler.dart', prefix: 'api'); | 9 #import('../compiler.dart', prefix: 'api'); |
| 10 #import('leg.dart', prefix: 'leg'); | 10 #import('leg.dart', prefix: 'leg'); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 bool mockableLibraryUsed = false; | 23 bool mockableLibraryUsed = false; |
| 24 | 24 |
| 25 Compiler(this.provider, this.handler, this.libraryRoot, this.packageRoot, | 25 Compiler(this.provider, this.handler, this.libraryRoot, this.packageRoot, |
| 26 List<String> options) | 26 List<String> options) |
| 27 : this.options = options, | 27 : this.options = options, |
| 28 super( | 28 super( |
| 29 tracer: new ssa.HTracer(), | 29 tracer: new ssa.HTracer(), |
| 30 enableTypeAssertions: hasOption(options, '--enable-checked-mode'), | 30 enableTypeAssertions: hasOption(options, '--enable-checked-mode'), |
| 31 enableUserAssertions: hasOption(options, '--enable-checked-mode'), | 31 enableUserAssertions: hasOption(options, '--enable-checked-mode'), |
| 32 enableMinification: hasOption(options, '--minify'), | 32 enableMinification: hasOption(options, '--minify'), |
| 33 emitJavascript: !hasOption(options, '--output-type=dart'), | 33 emitJavaScript: !hasOption(options, '--output-type=dart'), |
| 34 cutDeclarationTypes: hasOption(options, '--cut-declaration-types')); | 34 cutDeclarationTypes: hasOption(options, '--cut-declaration-types')); |
| 35 | 35 |
| 36 static bool hasOption(List<String> options, String option) { | 36 static bool hasOption(List<String> options, String option) { |
| 37 return options.indexOf(option) >= 0; | 37 return options.indexOf(option) >= 0; |
| 38 } | 38 } |
| 39 | 39 |
| 40 String lookupLibraryPath(String dartLibraryName) { | 40 String lookupLibraryPath(String dartLibraryName) { |
| 41 LibraryInfo info = LIBRARIES[dartLibraryName]; | 41 LibraryInfo info = LIBRARIES[dartLibraryName]; |
| 42 if (info === null) return null; | 42 if (info === null) return null; |
| 43 if (!info.isDart2jsLibrary) return null; | 43 if (!info.isDart2jsLibrary) return null; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 handler(translateUri(span.uri, null), span.begin, span.end, | 144 handler(translateUri(span.uri, null), span.begin, span.end, |
| 145 message, kind); | 145 message, kind); |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool get isMockCompilation { | 149 bool get isMockCompilation { |
| 150 return mockableLibraryUsed | 150 return mockableLibraryUsed |
| 151 && (options.indexOf('--allow-mock-compilation') !== -1); | 151 && (options.indexOf('--allow-mock-compilation') !== -1); |
| 152 } | 152 } |
| 153 } | 153 } |
| OLD | NEW |