| 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 10 matching lines...) Expand all Loading... |
| 21 final Uri packageRoot; | 21 final Uri packageRoot; |
| 22 List<String> options; | 22 List<String> options; |
| 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 emitJavascript: options.indexOf('--output-type=dart') == -1); | 31 emitJavascript: options.indexOf('--output-type=dart') == -1, |
| 32 validateUnparse: options.indexOf('--unparse-validation') !== -1); |
| 32 | 33 |
| 33 elements.LibraryElement scanBuiltinLibrary(String path) { | 34 elements.LibraryElement scanBuiltinLibrary(String path) { |
| 34 Uri uri = libraryRoot.resolve(DART2JS_LIBRARY_MAP[path]); | 35 Uri uri = libraryRoot.resolve(DART2JS_LIBRARY_MAP[path]); |
| 35 elements.LibraryElement library = scanner.loadLibrary(uri, null); | 36 elements.LibraryElement library = scanner.loadLibrary(uri, null); |
| 36 return library; | 37 return library; |
| 37 } | 38 } |
| 38 | 39 |
| 39 void log(message) { | 40 void log(message) { |
| 40 handler(null, null, null, message, false); | 41 handler(null, null, null, message, false); |
| 41 } | 42 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } else { | 96 } else { |
| 96 handler(span.uri, span.begin, span.end, message, fatal); | 97 handler(span.uri, span.begin, span.end, message, fatal); |
| 97 } | 98 } |
| 98 } | 99 } |
| 99 | 100 |
| 100 bool get isMockCompilation() { | 101 bool get isMockCompilation() { |
| 101 return mockableLibraryUsed | 102 return mockableLibraryUsed |
| 102 && (options.indexOf('--allow-mock-compilation') !== -1); | 103 && (options.indexOf('--allow-mock-compilation') !== -1); |
| 103 } | 104 } |
| 104 } | 105 } |
| OLD | NEW |