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

Side by Side Diff: runtime/vm/parser.cc

Issue 1640853004: Support 'dart.library.X' env variables in the VM. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 #include "vm/flags.h" 6 #include "vm/flags.h"
7 7
8 #ifndef DART_PRECOMPILED_RUNTIME 8 #ifndef DART_PRECOMPILED_RUNTIME
9 9
10 #include "lib/invocation_mirror.h" 10 #include "lib/invocation_mirror.h"
(...skipping 5773 matching lines...) Expand 10 before | Expand all | Expand 10 after
5784 continue; 5784 continue;
5785 } 5785 }
5786 // Check if this conditional line overrides the default import. 5786 // Check if this conditional line overrides the default import.
5787 const String& key = String::Handle( 5787 const String& key = String::Handle(
5788 String::ConcatAll(Array::Handle(Array::MakeArray(pieces)))); 5788 String::ConcatAll(Array::Handle(Array::MakeArray(pieces))));
5789 const String& value = (valueNode == NULL) 5789 const String& value = (valueNode == NULL)
5790 ? Symbols::True() 5790 ? Symbols::True()
5791 : String::Cast(valueNode->AsLiteralNode()->literal()); 5791 : String::Cast(valueNode->AsLiteralNode()->literal());
5792 // Call the embedder to supply us with the environment. 5792 // Call the embedder to supply us with the environment.
5793 const String& env_value = 5793 const String& env_value =
5794 String::Handle(Api::CallEnvironmentCallback(T, key)); 5794 String::Handle(Api::GetEnvironmentValue(T, key));
5795 if (!env_value.IsNull() && env_value.Equals(value)) { 5795 if (!env_value.IsNull() && env_value.Equals(value)) {
5796 condition_triggered = true; 5796 condition_triggered = true;
5797 url_literal = conditional_url_literal; 5797 url_literal = conditional_url_literal;
5798 } 5798 }
5799 } 5799 }
5800 } 5800 }
5801 ASSERT(url_literal->IsLiteralNode()); 5801 ASSERT(url_literal->IsLiteralNode());
5802 ASSERT(url_literal->AsLiteralNode()->literal().IsString()); 5802 ASSERT(url_literal->AsLiteralNode()->literal().IsString());
5803 const String& url = String::Cast(url_literal->AsLiteralNode()->literal()); 5803 const String& url = String::Cast(url_literal->AsLiteralNode()->literal());
5804 if (url.Length() == 0) { 5804 if (url.Length() == 0) {
(...skipping 8603 matching lines...) Expand 10 before | Expand all | Expand 10 after
14408 const ArgumentListNode& function_args, 14408 const ArgumentListNode& function_args,
14409 const LocalVariable* temp_for_last_arg, 14409 const LocalVariable* temp_for_last_arg,
14410 bool is_super_invocation) { 14410 bool is_super_invocation) {
14411 UNREACHABLE(); 14411 UNREACHABLE();
14412 return NULL; 14412 return NULL;
14413 } 14413 }
14414 14414
14415 } // namespace dart 14415 } // namespace dart
14416 14416
14417 #endif // DART_PRECOMPILED_RUNTIME 14417 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698