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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1668253002: Revert "Support 'dart.library.X' env variables in the VM." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/vm/dart_api_impl.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « runtime/vm/dart_api_impl.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698