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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart2js.dart

Issue 12280012: Apply Issue 12253048: "Add back --disallow-unsafe-eval for M3. This flag will be temporarily disabl… (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dart2js; 5 library dart2js;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection' show Queue, LinkedHashMap; 8 import 'dart:collection' show Queue, LinkedHashMap;
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:uri'; 10 import 'dart:uri';
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 for (String category in categories) { 144 for (String category in categories) {
145 if (!allowedCategories.contains(category)) { 145 if (!allowedCategories.contains(category)) {
146 fail('Error: unsupported library category "$category", ' 146 fail('Error: unsupported library category "$category", '
147 'supported categories are: $allowedCategoriesString'); 147 'supported categories are: $allowedCategoriesString');
148 } 148 }
149 } 149 }
150 } 150 }
151 return passThrough('--categories=${categories.join(",")}'); 151 return passThrough('--categories=${categories.join(",")}');
152 } 152 }
153 153
154 // TODO(8522): Remove this method once option is restored.
155 complainAboutDisallowUnsafeEval(String argument) {
156 fail('Error: $argument is currently not supported, '
157 'see http://dartbug.com/8522');
158 }
159
160 handleShortOptions(String argument) { 154 handleShortOptions(String argument) {
161 var shortOptions = argument.substring(1).split(""); 155 var shortOptions = argument.substring(1).split("");
162 for (var shortOption in shortOptions) { 156 for (var shortOption in shortOptions) {
163 switch (shortOption) { 157 switch (shortOption) {
164 case 'v': 158 case 'v':
165 diagnosticHandler.verbose = true; 159 diagnosticHandler.verbose = true;
166 break; 160 break;
167 case 'h': 161 case 'h':
168 case '?': 162 case '?':
169 wantHelp = true; 163 wantHelp = true;
(...skipping 25 matching lines...) Expand all
195 new OptionHandler('--disable-diagnostic-colors', 189 new OptionHandler('--disable-diagnostic-colors',
196 (_) => diagnosticHandler.enableColors = false), 190 (_) => diagnosticHandler.enableColors = false),
197 new OptionHandler('--enable-diagnostic-colors', 191 new OptionHandler('--enable-diagnostic-colors',
198 (_) => diagnosticHandler.enableColors = true), 192 (_) => diagnosticHandler.enableColors = true),
199 new OptionHandler('--enable[_-]checked[_-]mode|--checked', 193 new OptionHandler('--enable[_-]checked[_-]mode|--checked',
200 (_) => passThrough('--enable-checked-mode')), 194 (_) => passThrough('--enable-checked-mode')),
201 new OptionHandler('--enable-concrete-type-inference', 195 new OptionHandler('--enable-concrete-type-inference',
202 (_) => passThrough('--enable-concrete-type-inference')), 196 (_) => passThrough('--enable-concrete-type-inference')),
203 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), 197 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true),
204 new OptionHandler('--package-root=.+|-p.+', setPackageRoot), 198 new OptionHandler('--package-root=.+|-p.+', setPackageRoot),
205 new OptionHandler('--disallow-unsafe-eval', 199 new OptionHandler('--disallow-unsafe-eval', passThrough),
206 complainAboutDisallowUnsafeEval),
207 new OptionHandler('--analyze-all', passThrough), 200 new OptionHandler('--analyze-all', passThrough),
208 new OptionHandler('--analyze-only', setAnalyzeOnly), 201 new OptionHandler('--analyze-only', setAnalyzeOnly),
209 new OptionHandler('--disable-native-live-type-analysis', passThrough), 202 new OptionHandler('--disable-native-live-type-analysis', passThrough),
210 new OptionHandler('--reject-deprecated-language-features', passThrough), 203 new OptionHandler('--reject-deprecated-language-features', passThrough),
211 new OptionHandler('--report-sdk-use-of-deprecated-language-features', 204 new OptionHandler('--report-sdk-use-of-deprecated-language-features',
212 passThrough), 205 passThrough),
213 new OptionHandler('--categories=.*', setCategories), 206 new OptionHandler('--categories=.*', setCategories),
214 207
215 // The following two options must come last. 208 // The following two options must come last.
216 new OptionHandler('-.*', (String argument) { 209 new OptionHandler('-.*', (String argument) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 Do not generate a call to main if either of the following 427 Do not generate a call to main if either of the following
435 libraries are used: dart:dom, dart:html dart:io. 428 libraries are used: dart:dom, dart:html dart:io.
436 429
437 --enable-concrete-type-inference 430 --enable-concrete-type-inference
438 Enable experimental concrete type inference. 431 Enable experimental concrete type inference.
439 432
440 --disable-native-live-type-analysis 433 --disable-native-live-type-analysis
441 Disable the optimization that removes unused native types from dart:html 434 Disable the optimization that removes unused native types from dart:html
442 and related libraries. 435 and related libraries.
443 436
444 '''
445 /* TODO(8522): Restore this comment once option is restored.
446 '''
447 --disallow-unsafe-eval 437 --disallow-unsafe-eval
448 Disable dynamic generation of code in the generated output. This is 438 Disable dynamic generation of code in the generated output. This is
449 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/). 439 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/).
450 This flag is not continuously tested. Please report breakages and we 440 This flag is not continuously tested. Please report breakages and we
451 will fix them as soon as possible. 441 will fix them as soon as possible.
452 442
453 '''
454 */
455 '''
456 --reject-deprecated-language-features 443 --reject-deprecated-language-features
457 Reject deprecated language features. Without this option, the 444 Reject deprecated language features. Without this option, the
458 compiler will accept language features that are no longer valid 445 compiler will accept language features that are no longer valid
459 according to The Dart Programming Language Specification, version 446 according to The Dart Programming Language Specification, version
460 0.12, M1. 447 0.12, M1.
461 448
462 --report-sdk-use-of-deprecated-language-features 449 --report-sdk-use-of-deprecated-language-features
463 Report use of deprecated features in Dart platform libraries. 450 Report use of deprecated features in Dart platform libraries.
464 Without this option, the compiler will silently accept use of 451 Without this option, the compiler will silently accept use of
465 deprecated language features from these libraries. The option 452 deprecated language features from these libraries. The option
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 } catch (ignored) { 487 } catch (ignored) {
501 print('Internal error: error while printing exception'); 488 print('Internal error: error while printing exception');
502 } 489 }
503 try { 490 try {
504 print(trace); 491 print(trace);
505 } finally { 492 } finally {
506 exit(253); // 253 is recognized as a crash by our test scripts. 493 exit(253); // 253 is recognized as a crash by our test scripts.
507 } 494 }
508 } 495 }
509 } 496 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698