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

Unified Diff: vm/object.cc

Issue 9359009: Implement support for specifying string interopolation style variable substitution in the import ... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 8 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.h ('k') | vm/parser.h » ('j') | vm/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.cc
===================================================================
--- vm/object.cc (revision 3975)
+++ vm/object.cc (working copy)
@@ -4000,6 +4000,11 @@
}
+void Library::set_import_map(const Array& map) const {
+ StorePointer(&raw_ptr()->import_map_, map.raw());
+}
+
+
void Library::SetName(const String& name) const {
// Only set name once.
ASSERT(!Loaded());
@@ -4469,6 +4474,23 @@
}
+RawString* Library::LookupImportMap(const String& ident) const {
+ Array& import_map = Array::Handle(this->import_map());
+ intptr_t length = import_map.Length();
+ intptr_t index = 0;
+ String& name = String::Handle();
+ while (index < (length - 1)) {
+ name ^= import_map.At(index);
+ if (name.Equals(ident)) {
+ name ^= import_map.At(index + 1);
+ return name.raw();
+ }
+ index += 2;
+ }
+ return String::null();
+}
+
+
void Library::AddImport(const Library& library) const {
Array& imports = Array::Handle(this->imports());
intptr_t capacity = imports.Length();
@@ -4544,6 +4566,7 @@
result.raw_ptr()->dictionary_ = Array::Empty();
result.raw_ptr()->anonymous_classes_ = Array::Empty();
result.raw_ptr()->num_anonymous_ = 0;
+ result.raw_ptr()->import_map_ = Array::Empty();
hausner 2012/02/08 18:28:47 I don't see that this field is written to the snap
siva 2012/02/08 23:23:47 The field is written out in a snapshot (all object
result.raw_ptr()->imports_ = Array::Empty();
result.raw_ptr()->next_registered_ = Library::null();
result.raw_ptr()->loaded_scripts_ = Array::null();
« no previous file with comments | « vm/object.h ('k') | vm/parser.h » ('j') | vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698