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

Unified Diff: runtime/bin/main.cc

Issue 10887024: Move print to corelib. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comment. Created 8 years, 4 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 | « runtime/bin/builtin.dart ('k') | runtime/lib/lib_impl_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 014ecd6cc54c02d12a65a647bc20c8219cda8cf1..9ce7fcf9bfd38d0464541a079c1535fb723ecbc4 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -465,15 +465,11 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
}
return Extensions::LoadExtension(url_string, library);
}
- result = DartUtils::LoadSource(NULL,
- library,
- url,
- tag,
- url_string);
- if (!Dart_IsError(result) && (tag == kImportTag)) {
- Builtin::ImportLibrary(result, Builtin::kBuiltinLibrary);
- }
- return result;
+ return DartUtils::LoadSource(NULL,
+ library,
+ url,
+ tag,
+ url_string);
}
@@ -591,6 +587,14 @@ static bool CreateIsolateAndSetupHelper(const char* script_uri,
return false;
}
+ // Setup the corelib 'print' function.
+ Dart_Handle print =
+ Dart_Invoke(builtin_lib, Dart_NewString("_getPrintClosure"), 0, 0);
+ Dart_Handle coreimpl = Dart_LookupLibrary(Dart_NewString("dart:coreimpl"));
+ Dart_Handle print_impl =
+ Dart_GetClass(coreimpl, Dart_NewString("PrintImplementation"));
+ Dart_SetField(print_impl, Dart_NewString("_printClosure"), print);
+
// Setup the IO library.
Dart_Handle io_lib = Builtin::LoadLibrary(Builtin::kIOLibrary);
Builtin::SetupIOLibrary(io_lib);
@@ -636,8 +640,6 @@ static bool CreateIsolateAndSetupHelper(const char* script_uri,
Dart_ShutdownIsolate();
return false;
}
- // Implicitly import builtin into app.
- Builtin::ImportLibrary(library, Builtin::kBuiltinLibrary);
Dart_ExitScope();
return true;
}
« no previous file with comments | « runtime/bin/builtin.dart ('k') | runtime/lib/lib_impl_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698