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

Unified Diff: runtime/vm/parser.cc

Issue 1152833002: Add a runtime flag to control availability of dart:mirrors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 8491a6894a63ae267a5dcdc418e3b79789e710bb..1abb8621a1bd8e41ee89bae504aa43693551f148 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -44,7 +44,8 @@ DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations.");
DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef.");
DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
DECLARE_FLAG(bool, warn_on_javascript_compatibility);
-
+DEFINE_FLAG(bool, enable_mirrors, true,
+ "Disable to make importing dart:mirrors an error.");
// Quick access to the current isolate and zone.
#define I (isolate())
@@ -5783,6 +5784,11 @@ void Parser::ParseLibraryImportExport(intptr_t metadata_pos) {
ReportError(import_pos, "private library is not accessible");
}
+ if (!FLAG_enable_mirrors && Symbols::DartMirrors().Equals(canon_url)) {
+ ReportError(import_pos,
+ "import of dart:mirrors with --enable-mirrors=false");
+ }
+
if (is_import) {
if (prefix.IsNull() || (prefix.Length() == 0)) {
ASSERT(!is_deferred_import);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698