Skip to content

Commit

Permalink
Define Uri.base as CWD to match the standalone Dart VM. (flutter#5137)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmacnak-google authored May 1, 2018
1 parent 6f15a91 commit 2812ea3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/ui/dart_runtime_hooks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ static void InitDartInternal(Dart_Handle builtin_library, bool is_ui_isolate) {
}

static void InitDartCore(Dart_Handle builtin, const std::string& script_uri) {
DART_CHECK_VALID(
Dart_SetField(builtin, ToDart("_baseURL"), ToDart(script_uri)));
Dart_Handle get_base_url = GetClosure(builtin, "_getGetBaseURLClosure");
Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io"));
Dart_Handle get_base_url =
Dart_Invoke(io_lib, ToDart("_getUriBaseClosure"), 0, NULL);
Dart_Handle core_library = Dart_LookupLibrary(ToDart("dart:core"));
DART_CHECK_VALID(
Dart_SetField(core_library, ToDart("_uriBaseClosure"), get_base_url));
Expand Down
4 changes: 0 additions & 4 deletions lib/ui/natives.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,11 @@ void _setupHooks() {

void _scheduleMicrotask(void callback()) native 'ScheduleMicrotask';

String _baseURL;
Uri _getBaseURL() => Uri.parse(_baseURL);

// Required for gen_snapshot to work correctly.
int _isolateId;

Function _getPrintClosure() => _print;
Function _getScheduleMicrotaskClosure() => _scheduleMicrotask;
Function _getGetBaseURLClosure() => _getBaseURL;

// Though the "main" symbol is not included in any of the libraries imported
// above, the builtin library will be included manually during VM setup. This
Expand Down
3 changes: 1 addition & 2 deletions runtime/dart_vm_entry_points.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
dart:_internal,::,_printClosure
dart:async,::,_setScheduleImmediateClosure
dart:io,::,_getUriBaseClosure
dart:io,::,_setupHooks
dart:io,_Platform,_localeClosure
dart:io,_Platform,set:_nativeScript
Expand All @@ -11,8 +12,6 @@ dart:ui,::,_dispatchPlatformMessage
dart:ui,::,_dispatchPointerDataPacket
dart:ui,::,_dispatchSemanticsAction
dart:ui,::,_drawFrame
dart:ui,::,_getGetBaseURLClosure
dart:ui,::,_baseURL
dart:ui,::,_getLocaleClosure
dart:ui,::,_getMainClosure
dart:ui,::,_getPrintClosure
Expand Down

0 comments on commit 2812ea3

Please sign in to comment.