Chromium Code Reviews| 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: options.indexOf('--enable-checked-mode') != -1, | 30 enableTypeAssertions: options.indexOf('--enable-checked-mode') != -1, |
| 31 enableUserAssertions: options.indexOf('--enable-checked-mode') != -1, | 31 enableUserAssertions: options.indexOf('--enable-checked-mode') != -1, |
| 32 emitJavascript: options.indexOf('--output-type=dart') == -1, | 32 emitJavascript: options.indexOf('--output-type=dart') == -1, |
| 33 validateUnparse: options.indexOf('--unparse-validation') !== -1); | 33 validateUnparse: options.indexOf('--unparse-validation') !== -1, |
| 34 generateSourceMap: options.some((e) => e.startsWith( | |
|
ahe
2012/06/20 11:56:59
As discussed, we don't want to make it a command l
podivilov
2012/06/20 14:15:15
Done.
| |
| 35 '--source-map-out='))); | |
| 34 | 36 |
| 35 elements.LibraryElement scanBuiltinLibrary(String path) { | 37 elements.LibraryElement scanBuiltinLibrary(String path) { |
| 36 Uri uri = libraryRoot.resolve(DART2JS_LIBRARY_MAP[path]); | 38 Uri uri = libraryRoot.resolve(DART2JS_LIBRARY_MAP[path]); |
| 37 elements.LibraryElement library = scanner.loadLibrary(uri, null); | 39 elements.LibraryElement library = scanner.loadLibrary(uri, null); |
| 38 return library; | 40 return library; |
| 39 } | 41 } |
| 40 | 42 |
| 41 void log(message) { | 43 void log(message) { |
| 42 handler(null, null, null, message, api.Diagnostic.VERBOSE_INFO); | 44 handler(null, null, null, message, api.Diagnostic.VERBOSE_INFO); |
| 43 } | 45 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 handler(translateUri(span.uri, null), span.begin, span.end, | 104 handler(translateUri(span.uri, null), span.begin, span.end, |
| 103 message, kind); | 105 message, kind); |
| 104 } | 106 } |
| 105 } | 107 } |
| 106 | 108 |
| 107 bool get isMockCompilation() { | 109 bool get isMockCompilation() { |
| 108 return mockableLibraryUsed | 110 return mockableLibraryUsed |
| 109 && (options.indexOf('--allow-mock-compilation') !== -1); | 111 && (options.indexOf('--allow-mock-compilation') !== -1); |
| 110 } | 112 } |
| 111 } | 113 } |
| OLD | NEW |