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

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

Issue 11188004: Add a content-security-policy (CSP) flag. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More fixes. 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('dart2js'); 5 #library('dart2js');
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 #import('dart:uri'); 8 #import('dart:uri');
9 #import('dart:utf'); 9 #import('dart:utf');
10 10
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 new OptionHandler('--force-strip=.*', setStrip), 148 new OptionHandler('--force-strip=.*', setStrip),
149 // TODO(ahe): Remove the --no-colors option. 149 // TODO(ahe): Remove the --no-colors option.
150 new OptionHandler('--disable-diagnostic-colors', 150 new OptionHandler('--disable-diagnostic-colors',
151 (_) => enableColors = false), 151 (_) => enableColors = false),
152 new OptionHandler('--enable-diagnostic-colors', (_) => enableColors = true), 152 new OptionHandler('--enable-diagnostic-colors', (_) => enableColors = true),
153 new OptionHandler('--enable[_-]checked[_-]mode|--checked', 153 new OptionHandler('--enable[_-]checked[_-]mode|--checked',
154 (_) => passThrough('--enable-checked-mode')), 154 (_) => passThrough('--enable-checked-mode')),
155 new OptionHandler('--enable-concrete-type-inference', 155 new OptionHandler('--enable-concrete-type-inference',
156 (_) => passThrough('--enable-concrete-type-inference')), 156 (_) => passThrough('--enable-concrete-type-inference')),
157 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true), 157 new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true),
158 new OptionHandler(r'--package-root=.+|-p.+', setPackageRoot), 158 new OptionHandler('--package-root=.+|-p.+', setPackageRoot),
159 new OptionHandler('--disallow-unsafe-eval', passThrough),
159 // The following two options must come last. 160 // The following two options must come last.
160 new OptionHandler('-.*', (String argument) { 161 new OptionHandler('-.*', (String argument) {
161 helpAndFail('Error: Unknown option "$argument".'); 162 helpAndFail('Error: Unknown option "$argument".');
162 }), 163 }),
163 new OptionHandler('.*', (String argument) { 164 new OptionHandler('.*', (String argument) {
164 arguments.add(nativeToUriPath(argument)); 165 arguments.add(nativeToUriPath(argument));
165 }) 166 })
166 ]; 167 ];
167 168
168 parseCommandLine(handlers, argv); 169 parseCommandLine(handlers, argv);
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 Throw an exception if a compile-time error is detected. 386 Throw an exception if a compile-time error is detected.
386 387
387 --library-root=<directory> 388 --library-root=<directory>
388 Where to find the Dart platform libraries. 389 Where to find the Dart platform libraries.
389 390
390 --allow-mock-compilation 391 --allow-mock-compilation
391 Do not generate a call to main if either of the following 392 Do not generate a call to main if either of the following
392 libraries are used: dart:dom, dart:html dart:io. 393 libraries are used: dart:dom, dart:html dart:io.
393 394
394 --enable-concrete-type-inference 395 --enable-concrete-type-inference
395 Enable experimental concrete type inference.'''); 396 Enable experimental concrete type inference.
397
398 --disallow-unsafe-eval
399 Disables dynamic generation of code in the generated output. This is
400 necessary to satisfy CSP restrictions (see http://www.w3.org/TR/CSP/).
401 This flag is not continuously tested. Please report breakages and we
402 will fix them as soon as possible.''');
396 } 403 }
397 404
398 void helpAndExit(bool verbose) { 405 void helpAndExit(bool verbose) {
399 if (verbose) { 406 if (verbose) {
400 verboseHelp(); 407 verboseHelp();
401 } else { 408 } else {
402 help(); 409 help();
403 } 410 }
404 exit(0); 411 exit(0);
405 } 412 }
(...skipping 13 matching lines...) Expand all
419 } catch (ignored) { 426 } catch (ignored) {
420 print('Internal error: error while printing exception'); 427 print('Internal error: error while printing exception');
421 } 428 }
422 try { 429 try {
423 print(trace); 430 print(trace);
424 } finally { 431 } finally {
425 exit(253); // 253 is recognized as a crash by our test scripts. 432 exit(253); // 253 is recognized as a crash by our test scripts.
426 } 433 }
427 } 434 }
428 } 435 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/compiler.dart ('k') | lib/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698