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

Unified Diff: bin/builtin_nolib.cc

Issue 9417012: - Add dart:json, dart:uri and dart:utf8 to the known and builtin libraries. (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 | « bin/builtin_in.cc ('k') | bin/dartutils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/builtin_nolib.cc
===================================================================
--- bin/builtin_nolib.cc (revision 4317)
+++ bin/builtin_nolib.cc (working copy)
@@ -29,11 +29,25 @@
void Builtin::ImportLibrary(Dart_Handle library, BuiltinLibraryId id) {
Dart_Handle url;
- if (id == kBuiltinLibrary) {
- url = Dart_NewString(DartUtils::kBuiltinLibURL);
- } else {
- ASSERT(id == kIOLibrary);
- url = Dart_NewString(DartUtils::kIOLibURL);
+ switch (id) {
+ case kBuiltinLibrary:
+ url = Dart_NewString(DartUtils::kBuiltinLibURL);
+ break;
+ case kIOLibrary:
+ url = Dart_NewString(DartUtils::kIOLibURL);
+ break;
+ case kJsonLibrary:
+ url = Dart_NewString(DartUtils::kJsonLibURL);
+ break;
+ case kUriLibrary:
+ url = Dart_NewString(DartUtils::kUriLibURL);
+ break;
+ case kUtf8Library:
+ url = Dart_NewString(DartUtils::kUtf8LibURL);
+ break;
+ default:
+ url = Dart_Error("Unknown builtin library requested.");
+ UNREACHABLE();
}
Dart_Handle imported_library = Dart_LookupLibrary(url);
// Import the builtin library into current library.
« no previous file with comments | « bin/builtin_in.cc ('k') | bin/dartutils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698