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

Unified Diff: vm/parser.cc

Issue 12220027: - Add handling of private dart:_ libraries. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/object.cc ('k') | vm/symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/parser.cc
===================================================================
--- vm/parser.cc (revision 18158)
+++ vm/parser.cc (working copy)
@@ -4255,6 +4255,13 @@
const Namespace& ns =
Namespace::Handle(Namespace::New(library, show_names, hide_names));
if (is_import) {
+ // Ensure that private dart:_ libraries are only imported into dart:
+ // libraries.
+ const String& lib_url = String::Handle(library_.url());
+ if (canon_url.StartsWith(Symbols::DartSchemePrivate()) &&
+ !lib_url.StartsWith(Symbols::DartScheme())) {
+ ErrorMsg(import_pos, "private library is not accessible");
+ }
if (prefix.IsNull() || (prefix.Length() == 0)) {
library_.AddImport(ns);
} else {
« no previous file with comments | « vm/object.cc ('k') | vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698