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

Unified Diff: runtime/vm/parser.cc

Issue 10907064: Fix argument definition test (issue 4888). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | runtime/vm/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 11834)
+++ runtime/vm/parser.cc (working copy)
@@ -8928,10 +8928,6 @@
LocalVariable* saved_args_desc_var = LookupLocalScope(saved_args_desc_name);
if (saved_args_desc_var == NULL) {
ASSERT(owner_scope != NULL);
- ASSERT(owner_function.raw() == current_function().raw());
- // We currently generate code for 'owner_function', otherwise the variable
- // would have been created when compiling the enclosing function of the
- // currently being compiled local function.
saved_args_desc_var =
new LocalVariable(owner_function.token_pos(),
saved_args_desc_name,
@@ -8945,18 +8941,14 @@
bool success = owner_scope->AddVariable(saved_args_desc_var);
ASSERT(success);
// Capture the saved argument descriptor variable if necessary.
- if (current_function().raw() != innermost_function().raw()) {
- LocalVariable* local = LookupLocalScope(saved_args_desc_name);
- ASSERT(local == saved_args_desc_var);
- ASSERT(local->is_captured());
- }
- } else {
- // If we currently generate code for a local function of the owner function,
- // the saved arguments descriptor variable must have been captured by the
- // above lookup.
- ASSERT((owner_function.raw() == current_function().raw()) ||
- saved_args_desc_var->is_captured());
+ LocalVariable* local = LookupLocalScope(saved_args_desc_name);
+ ASSERT(local == saved_args_desc_var);
}
+ // If we currently generate code for the local function of an enclosing owner
+ // function, the saved arguments descriptor variable must have been captured
+ // by the above lookup.
+ ASSERT((owner_function.raw() == innermost_function().raw()) ||
+ saved_args_desc_var->is_captured());
const String& param_name = String::ZoneHandle(Symbols::New(*ident));
return new ArgumentDefinitionTestNode(
test_pos, param_index, param_name, saved_args_desc_var);
« no previous file with comments | « no previous file | runtime/vm/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698