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

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: Two new lines between functions. 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 5758 matching lines...) Expand 10 before | Expand all | Expand 10 after
5769 continue; 5769 continue;
5770 } 5770 }
5771 // Check if this conditional line overrides the default import. 5771 // Check if this conditional line overrides the default import.
5772 const String& key = String::Handle( 5772 const String& key = String::Handle(
5773 String::ConcatAll(Array::Handle(Array::MakeArray(pieces)))); 5773 String::ConcatAll(Array::Handle(Array::MakeArray(pieces))));
5774 const String& value = (valueNode == NULL) 5774 const String& value = (valueNode == NULL)
5775 ? Symbols::True() 5775 ? Symbols::True()
5776 : String::Cast(valueNode->AsLiteralNode()->literal()); 5776 : String::Cast(valueNode->AsLiteralNode()->literal());
5777 // Call the embedder to supply us with the environment. 5777 // Call the embedder to supply us with the environment.
5778 const String& env_value = 5778 const String& env_value =
5779 String::Handle(Api::CallEnvironmentCallback(T, key)); 5779 String::Handle(Api::GetEnvironmentValue(T, key));
5780 if (!env_value.IsNull() && env_value.Equals(value)) { 5780 if (!env_value.IsNull() && env_value.Equals(value)) {
5781 condition_triggered = true; 5781 condition_triggered = true;
5782 url_literal = conditional_url_literal; 5782 url_literal = conditional_url_literal;
5783 } 5783 }
5784 } 5784 }
5785 } 5785 }
5786 ASSERT(url_literal->IsLiteralNode()); 5786 ASSERT(url_literal->IsLiteralNode());
5787 ASSERT(url_literal->AsLiteralNode()->literal().IsString()); 5787 ASSERT(url_literal->AsLiteralNode()->literal().IsString());
5788 const String& url = String::Cast(url_literal->AsLiteralNode()->literal()); 5788 const String& url = String::Cast(url_literal->AsLiteralNode()->literal());
5789 if (url.Length() == 0) { 5789 if (url.Length() == 0) {
(...skipping 8564 matching lines...) Expand 10 before | Expand all | Expand 10 after
14354 const ArgumentListNode& function_args, 14354 const ArgumentListNode& function_args,
14355 const LocalVariable* temp_for_last_arg, 14355 const LocalVariable* temp_for_last_arg,
14356 bool is_super_invocation) { 14356 bool is_super_invocation) {
14357 UNREACHABLE(); 14357 UNREACHABLE();
14358 return NULL; 14358 return NULL;
14359 } 14359 }
14360 14360
14361 } // namespace dart 14361 } // namespace dart
14362 14362
14363 #endif // DART_PRECOMPILED_RUNTIME 14363 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698