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

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 and fix typo. Created 4 years, 9 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
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5778 matching lines...) Expand 10 before | Expand all | Expand 10 after
5789 continue; 5789 continue;
5790 } 5790 }
5791 // Check if this conditional line overrides the default import. 5791 // Check if this conditional line overrides the default import.
5792 const String& key = String::Handle( 5792 const String& key = String::Handle(
5793 String::ConcatAll(Array::Handle(Array::MakeArray(pieces)))); 5793 String::ConcatAll(Array::Handle(Array::MakeArray(pieces))));
5794 const String& value = (valueNode == NULL) 5794 const String& value = (valueNode == NULL)
5795 ? Symbols::True() 5795 ? Symbols::True()
5796 : String::Cast(valueNode->AsLiteralNode()->literal()); 5796 : String::Cast(valueNode->AsLiteralNode()->literal());
5797 // Call the embedder to supply us with the environment. 5797 // Call the embedder to supply us with the environment.
5798 const String& env_value = 5798 const String& env_value =
5799 String::Handle(Api::CallEnvironmentCallback(T, key)); 5799 String::Handle(Api::GetEnvironmentValue(T, key));
5800 if (!env_value.IsNull() && env_value.Equals(value)) { 5800 if (!env_value.IsNull() && env_value.Equals(value)) {
5801 condition_triggered = true; 5801 condition_triggered = true;
5802 url_literal = conditional_url_literal; 5802 url_literal = conditional_url_literal;
5803 } 5803 }
5804 } 5804 }
5805 } 5805 }
5806 ASSERT(url_literal->IsLiteralNode()); 5806 ASSERT(url_literal->IsLiteralNode());
5807 ASSERT(url_literal->AsLiteralNode()->literal().IsString()); 5807 ASSERT(url_literal->AsLiteralNode()->literal().IsString());
5808 const String& url = String::Cast(url_literal->AsLiteralNode()->literal()); 5808 const String& url = String::Cast(url_literal->AsLiteralNode()->literal());
5809 if (url.Length() == 0) { 5809 if (url.Length() == 0) {
(...skipping 8604 matching lines...) Expand 10 before | Expand all | Expand 10 after
14414 const ArgumentListNode& function_args, 14414 const ArgumentListNode& function_args,
14415 const LocalVariable* temp_for_last_arg, 14415 const LocalVariable* temp_for_last_arg,
14416 bool is_super_invocation) { 14416 bool is_super_invocation) {
14417 UNREACHABLE(); 14417 UNREACHABLE();
14418 return NULL; 14418 return NULL;
14419 } 14419 }
14420 14420
14421 } // namespace dart 14421 } // namespace dart
14422 14422
14423 #endif // DART_PRECOMPILED_RUNTIME 14423 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698