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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 964853002: Let CSP-mode-flag be available as a foreign_helper constant. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index e3f527f50373789a5900546a1025fa91c849e756..228817dbf88e984782b713bb8ccaf837fd01d880 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -3711,12 +3711,17 @@ class SsaBuilder extends ResolvedVisitor {
}
String name = string.dartString.slowToString();
bool value = false;
- if (name == 'MUST_RETAIN_METADATA') {
- value = backend.mustRetainMetadata;
- } else {
- compiler.reportError(
- node, MessageKind.GENERIC,
- {'text': 'Error: Unknown internal flag "$name".'});
+ switch (name) {
+ case 'MUST_RETAIN_METADATA':
+ value = backend.mustRetainMetadata;
+ break;
+ case 'USE_CONTENT_SECURITY_POLICY':
+ value = compiler.useContentSecurityPolicy;
+ break;
+ default:
+ compiler.reportError(
+ node, MessageKind.GENERIC,
+ {'text': 'Error: Unknown internal flag "$name".'});
}
stack.add(graph.addConstantBool(value, compiler));
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698