Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index ac2b4613d296d8ed8a45b87bacbda6537a879d94..a3bccb69463c5abb9e4dc11217e3eefc7207d548 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -4949,35 +4949,6 @@ DART_EXPORT void Dart_SetWeakHandleReturnValue(Dart_NativeArguments args, |
// --- Environment --- |
-RawString* Api::GetEnvironmentValue(Thread* thread, const String& name) { |
- String& result = String::Handle(CallEnvironmentCallback(thread, name)); |
- if (result.IsNull()) { |
- // Every 'dart:X' library introduces an environment variable |
- // 'dart.library.X' that is set to 'true'. |
- const String& prefix = Symbols::DartLibrary(); |
- if (name.StartsWith(prefix)) { |
- const String& library_name = |
- String::Handle(String::SubString(name, prefix.Length())); |
- if (!library_name.IsNull()) { |
- const String& dart_library_name = |
- String::Handle(String::Concat(Symbols::DartScheme(), library_name)); |
- const Library& library = |
- Library::Handle(Library::LookupLibrary(dart_library_name)); |
- if (!library.IsNull()) { |
- return Symbols::True().raw(); |
- } |
- } |
- } |
- // Check for default VM provided values. If it was not overriden on the |
- // command line. |
- if (Symbols::DartIsVM().Equals(name)) { |
- return Symbols::True().raw(); |
- } |
- } |
- return result.raw(); |
-} |
- |
- |
RawString* Api::CallEnvironmentCallback(Thread* thread, const String& name) { |
Isolate* isolate = thread->isolate(); |
Dart_EnvironmentCallback callback = isolate->environment_callback(); |
@@ -4999,6 +4970,15 @@ RawString* Api::CallEnvironmentCallback(Thread* thread, const String& name) { |
String::Handle(String::New("Illegal environment value"))); |
} |
} |
+ if (result.IsNull()) { |
+ // TODO(iposva): Determine whether builtin values can be overriden by the |
+ // embedder. |
+ // Check for default VM provided values. If it was not overriden on the |
+ // command line. |
+ if (Symbols::DartIsVM().Equals(name)) { |
+ return Symbols::True().raw(); |
+ } |
+ } |
return result.raw(); |
} |