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

Unified Diff: bin/gen_snapshot.cc

Issue 10388242: Minor restructure some of the builtin library processing code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 | « bin/builtin_nolib.cc ('k') | bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/gen_snapshot.cc
===================================================================
--- bin/gen_snapshot.cc (revision 8133)
+++ bin/gen_snapshot.cc (working copy)
@@ -177,17 +177,21 @@
}
ASSERT(tag == kImportTag);
// Handle imports of other built-in libraries present in the SDK.
+ Builtin::BuiltinLibraryId id;
if (DartUtils::IsDartCryptoLibURL(url_string)) {
- return Builtin::LoadLibrary(Builtin::kCryptoLibrary);
+ id = Builtin::kCryptoLibrary;
} else if (DartUtils::IsDartIOLibURL(url_string)) {
- return Builtin::LoadLibrary(Builtin::kIOLibrary);
+ id = Builtin::kIOLibrary;
} else if (DartUtils::IsDartJsonLibURL(url_string)) {
- return Builtin::LoadLibrary(Builtin::kJsonLibrary);
+ id = Builtin::kJsonLibrary;
} else if (DartUtils::IsDartUriLibURL(url_string)) {
- return Builtin::LoadLibrary(Builtin::kUriLibrary);
+ id = Builtin::kUriLibrary;
} else if (DartUtils::IsDartUtfLibURL(url_string)) {
- return Builtin::LoadLibrary(Builtin::kUtfLibrary);
+ id = Builtin::kUtfLibrary;
+ } else {
+ return Dart_Error("Do not know how to load '%s'", url_string);
}
+ return Builtin::LoadLibrary(id);
}
return Dart_Error("unexpected tag encountered %d", tag);
}
« no previous file with comments | « bin/builtin_nolib.cc ('k') | bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698