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

Unified Diff: runtime/bin/dartutils.cc

Issue 23686021: Add property base to the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed more review comments Created 7 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 | « runtime/bin/builtin.dart ('k') | runtime/lib/uri.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 423927910b58848d14a41805d428507948ddd88d..eabd4f37a581cdb020a182a0aa3757499470ce99 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -659,13 +659,16 @@ Dart_Handle DartUtils::LoadSource(CommandLineOptions* url_mapping,
Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root,
Dart_Handle builtin_lib) {
+ Dart_Handle corelib = Dart_LookupLibrary(NewString("dart:core"));
+ DART_CHECK_VALID(corelib);
+
// Setup the corelib 'print' function.
Dart_Handle print = Dart_Invoke(
builtin_lib, NewString("_getPrintClosure"), 0, NULL);
- Dart_Handle corelib = Dart_LookupLibrary(NewString("dart:core"));
Dart_Handle result = Dart_SetField(corelib,
NewString("_printClosure"),
print);
+ DART_CHECK_VALID(result);
// Setup the 'timer' factory.
Dart_Handle url = NewString(kAsyncLibURL);
@@ -680,6 +683,14 @@ Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root,
DART_CHECK_VALID(Dart_Invoke(
async_lib, NewString("_setTimerFactoryClosure"), 1, args));
+ // Setup the corelib 'Uri.base' getter.
+ Dart_Handle uri_base = Dart_Invoke(
+ builtin_lib, NewString("_getUriBaseClosure"), 0, NULL);
+ DART_CHECK_VALID(uri_base);
+ result = Dart_SetField(corelib,
+ NewString("_uriBaseClosure"),
+ uri_base);
+ DART_CHECK_VALID(result);
if (IsWindowsHost()) {
// Set running on Windows flag.
« no previous file with comments | « runtime/bin/builtin.dart ('k') | runtime/lib/uri.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698