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

Unified Diff: bin/builtin_nolib.cc

Issue 10911135: Simplify the builtin functions and get rid of unused code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 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_natives.cc ('k') | bin/dartutils.cc » ('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 11998)
+++ bin/builtin_nolib.cc (working copy)
@@ -30,11 +30,14 @@
}
-void Builtin::SetupLibrary(Dart_Handle library, BuiltinLibraryId id) {
+void Builtin::SetNativeResolver(BuiltinLibraryId id) {
ASSERT((sizeof(builtin_libraries_) / sizeof(builtin_lib_props)) ==
kInvalidLibrary);
ASSERT(id >= kBuiltinLibrary && id < kInvalidLibrary);
if (builtin_libraries_[id].has_natives_) {
+ Dart_Handle url = Dart_NewString(builtin_libraries_[id].url_);
+ Dart_Handle library = Dart_LookupLibrary(url);
+ ASSERT(!Dart_IsError(library));
// Setup the native resolver for built in library functions.
DART_CHECK_VALID(Dart_SetNativeResolver(library, NativeLookup));
}
@@ -48,21 +51,13 @@
Dart_Handle url = Dart_NewString(builtin_libraries_[id].url_);
Dart_Handle library = Dart_LookupLibrary(url);
if (Dart_IsError(library)) {
- ASSERT(id >= kCryptoLibrary && id < kInvalidLibrary);
+ ASSERT(id >= kWebLibrary && id < kInvalidLibrary);
library = Dart_LoadLibrary(url, Source(id));
- if (!Dart_IsError(library)) {
- SetupLibrary(library, id);
+ if (!Dart_IsError(library) && (builtin_libraries_[id].has_natives_)) {
+ // Setup the native resolver for built in library functions.
+ DART_CHECK_VALID(Dart_SetNativeResolver(library, NativeLookup));
}
}
DART_CHECK_VALID(library);
return library;
}
-
-
-void Builtin::ImportLibrary(Dart_Handle library, BuiltinLibraryId id) {
- Dart_Handle imported_library = LoadAndCheckLibrary(id);
- // Import the library into current library.
- DART_CHECK_VALID(Dart_LibraryImportLibrary(library,
- imported_library,
- Dart_Null()));
-}
« no previous file with comments | « bin/builtin_natives.cc ('k') | bin/dartutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698