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

Unified Diff: runtime/vm/scopes.cc

Issue 10697011: Include variable names with _ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scopes.cc
===================================================================
--- runtime/vm/scopes.cc (revision 9188)
+++ runtime/vm/scopes.cc (working copy)
@@ -214,6 +214,13 @@
}
+// The parser creates internal variables that start with ":"
+static bool IsInternalIdentifier(const String& str) {
+ ASSERT(str.Length() > 0);
+ return str.CharAt(0) == ':';
+}
+
+
// Add variables that are declared in this scope to vars, then collect
// variables of children, followed by siblings.
void LocalScope::CollectLocalVariables(GrowableArray<VarDesc>* vars,
@@ -237,7 +244,7 @@
for (int i = 0; i < this->variables_.length(); i++) {
LocalVariable* var = variables_[i];
if (var->owner() == this) {
- if (Scanner::IsIdent(var->name())) {
+ if (!IsInternalIdentifier(var->name())) {
// This is a regular Dart variable, either stack-based or captured.
VarDesc desc;
desc.name = &var->name();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698