Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Side by Side Diff: lib/compiler/implementation/apiimpl.dart

Issue 10963055: [dart2dart] Make removal of asserts and forcing type strips go under (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 13 matching lines...) Expand all
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 forceCutDeclarationTypes: 34 strips: getStrips(options));
35 hasOption(options, '--force-cut-declaration-types')); 35
36 static List<String> getStrips(List<String> options) {
37 for (String option in options) {
38 if (option.startsWith('--force-strip=')) {
39 return option.substring('--force-strip='.length).split(',');
40 }
41 }
42 return [];
43 }
36 44
37 static bool hasOption(List<String> options, String option) { 45 static bool hasOption(List<String> options, String option) {
38 return options.indexOf(option) >= 0; 46 return options.indexOf(option) >= 0;
39 } 47 }
40 48
41 String lookupLibraryPath(String dartLibraryName) { 49 String lookupLibraryPath(String dartLibraryName) {
42 LibraryInfo info = LIBRARIES[dartLibraryName]; 50 LibraryInfo info = LIBRARIES[dartLibraryName];
43 if (info === null) return null; 51 if (info === null) return null;
44 if (!info.isDart2jsLibrary) return null; 52 if (!info.isDart2jsLibrary) return null;
45 String path = info.dart2jsPath; 53 String path = info.dart2jsPath;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 handler(translateUri(span.uri, null), span.begin, span.end, 153 handler(translateUri(span.uri, null), span.begin, span.end,
146 message, kind); 154 message, kind);
147 } 155 }
148 } 156 }
149 157
150 bool get isMockCompilation { 158 bool get isMockCompilation {
151 return mockableLibraryUsed 159 return mockableLibraryUsed
152 && (options.indexOf('--allow-mock-compilation') !== -1); 160 && (options.indexOf('--allow-mock-compilation') !== -1);
153 } 161 }
154 } 162 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/compiler.dart » ('j') | lib/compiler/implementation/dart2js.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698