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

Unified Diff: bin/builtin_nolib.cc

Issue 9614006: - Proper URI resolution when loading scripts from the standalone binary. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 9 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.dart ('k') | bin/file.h » ('j') | bin/main.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/builtin_nolib.cc
===================================================================
--- bin/builtin_nolib.cc (revision 5061)
+++ bin/builtin_nolib.cc (working copy)
@@ -22,12 +22,6 @@
Dart_Handle Builtin::LoadLibrary(BuiltinLibraryId id) {
- UNREACHABLE();
- return Dart_Null();
-}
-
-
-void Builtin::ImportLibrary(Dart_Handle library, BuiltinLibraryId id) {
Dart_Handle url;
switch (id) {
case kBuiltinLibrary:
@@ -46,11 +40,19 @@
url = Dart_NewString(DartUtils::kUtf8LibURL);
break;
default:
- url = Dart_Error("Unknown builtin library requested.");
- UNREACHABLE();
+ return Dart_Error("Unknown builtin library requested.");
}
- Dart_Handle imported_library = Dart_LookupLibrary(url);
- // Import the builtin library into current library.
- DART_CHECK_VALID(imported_library);
+ Dart_Handle library = Dart_LookupLibrary(url);
+ if (Dart_IsError(library)) {
+ UNREACHABLE();
+ }
+ DART_CHECK_VALID(library);
+ return library;
+}
+
+
+void Builtin::ImportLibrary(Dart_Handle library, BuiltinLibraryId id) {
+ Dart_Handle imported_library = LoadLibrary(id);
+ // Import the library into current library.
DART_CHECK_VALID(Dart_LibraryImportLibrary(library, imported_library));
}
« no previous file with comments | « bin/builtin.dart ('k') | bin/file.h » ('j') | bin/main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698