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

Unified Diff: test/cctest/test-parsing.cc

Issue 2352593002: Preparse inner functions (new try) (Closed)
Patch Set: add comment Created 4 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 | « src/parsing/preparser.cc ('k') | test/mjsunit/debug-function-scopes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index b53fc4d7586b7c83af1c760a534ea72f9dc10455..3bce6ccb32cb9844164ff7f6190f2b52632a6af0 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -38,6 +38,7 @@
#include "src/ast/ast.h"
#include "src/compiler.h"
#include "src/execution.h"
+#include "src/flags.h"
#include "src/isolate.h"
#include "src/objects.h"
#include "src/parsing/parse-info.h"
@@ -3416,7 +3417,14 @@ TEST(InnerAssignment) {
bool expected = outers[i].assigned || inners[j].assigned;
CHECK(var != NULL);
CHECK(var->is_used() || !expected);
- CHECK((var->maybe_assigned() == i::kMaybeAssigned) == expected);
+ bool is_maybe_assigned = var->maybe_assigned() == i::kMaybeAssigned;
+ if (i::FLAG_lazy_inner_functions) {
+ // If we parse inner functions lazily, allow being pessimistic about
+ // maybe_assigned.
+ CHECK(is_maybe_assigned || (is_maybe_assigned == expected));
+ } else {
+ CHECK(is_maybe_assigned == expected);
+ }
}
}
}
« no previous file with comments | « src/parsing/preparser.cc ('k') | test/mjsunit/debug-function-scopes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698