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'); |
| 11 #import('tree/tree.dart', prefix: 'tree'); | 11 #import('tree/tree.dart', prefix: 'tree'); |
| 12 #import('elements/elements.dart', prefix: 'elements'); | 12 #import('elements/elements.dart', prefix: 'elements'); |
| 13 #import('ssa/tracer.dart', prefix: 'ssa'); | 13 #import('ssa/tracer.dart', prefix: 'ssa'); |
| 14 #import('library_map.dart'); | 14 #import('library_map.dart'); |
| 15 #import('source_file.dart'); | 15 #import('source_file.dart'); |
| 16 | 16 |
| 17 class Compiler extends leg.Compiler { | 17 class Compiler extends leg.Compiler { |
| 18 api.ReadUriFromString provider; | 18 api.ReadUriFromString provider; |
| 19 api.DiagnosticHandler handler; | 19 api.DiagnosticHandler handler; |
| 20 Uri libraryRoot; | 20 Uri libraryRoot; |
| 21 Uri packageRoot; | 21 Uri packageRoot; |
| 22 List<String> options; | 22 List<String> options; |
| 23 bool mockableLibraryUsed = false; | 23 bool mockableLibraryUsed = false; |
| 24 bool checkedMode = false; | |
|
ahe
2012/05/07 11:59:57
Developer mode, please.
ngeoffray
2012/05/07 13:15:42
Renamed to enableTypeAssertions.
| |
| 24 | 25 |
| 25 Compiler(this.provider, this.handler, this.libraryRoot, this.options) | 26 Compiler(this.provider, this.handler, this.libraryRoot, this.options) |
| 26 : super(tracer: new ssa.HTracer()); | 27 : super(tracer: new ssa.HTracer()) { |
| 28 checkedMode = options.indexOf('--enable-checked-mode') !== -1; | |
|
ahe
2012/05/07 11:59:57
I don't like this flag name. I think it should be
ngeoffray
2012/05/07 13:15:42
As discussed, keeping enable-checked-mode only for
| |
| 29 } | |
| 27 | 30 |
| 28 elements.LibraryElement scanBuiltinLibrary(String path) { | 31 elements.LibraryElement scanBuiltinLibrary(String path) { |
| 29 Uri uri = libraryRoot.resolve(DART2JS_LIBRARY_MAP[path]); | 32 Uri uri = libraryRoot.resolve(DART2JS_LIBRARY_MAP[path]); |
| 30 elements.LibraryElement library = scanner.loadLibrary(uri, null); | 33 elements.LibraryElement library = scanner.loadLibrary(uri, null); |
| 31 return library; | 34 return library; |
| 32 } | 35 } |
| 33 | 36 |
| 34 void log(message) { | 37 void log(message) { |
| 35 handler(null, null, null, message, false); | 38 handler(null, null, null, message, false); |
| 36 } | 39 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 handler(null, null, null, message, fatal); | 91 handler(null, null, null, message, fatal); |
| 89 } else { | 92 } else { |
| 90 handler(span.uri, span.begin, span.end, message, fatal); | 93 handler(span.uri, span.begin, span.end, message, fatal); |
| 91 } | 94 } |
| 92 } | 95 } |
| 93 | 96 |
| 94 bool get isMockCompilation() { | 97 bool get isMockCompilation() { |
| 95 return mockableLibraryUsed | 98 return mockableLibraryUsed |
| 96 && (options.indexOf('--allow-mock-compilation') !== -1); | 99 && (options.indexOf('--allow-mock-compilation') !== -1); |
| 97 } | 100 } |
| 101 | |
| 102 bool get isCheckedModeEnabled() { | |
|
ahe
2012/05/07 11:59:57
Developer mode, please.
ngeoffray
2012/05/07 13:15:42
I removed the getter.
| |
| 103 return checkedMode; | |
| 104 } | |
| 98 } | 105 } |
| OLD | NEW |