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

Side by Side Diff: test/cctest/test-parsing.cc

Issue 2168293002: Remove redundant Scope book-keeping (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Reinstate uses_super_property Created 4 years, 5 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 | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 1097
1098 i::Scope* scope = script_scope->inner_scope(); 1098 i::Scope* scope = script_scope->inner_scope();
1099 DCHECK_NOT_NULL(scope); 1099 DCHECK_NOT_NULL(scope);
1100 DCHECK_NULL(scope->sibling()); 1100 DCHECK_NULL(scope->sibling());
1101 // Adjust for constructor scope. 1101 // Adjust for constructor scope.
1102 if (j == 2) { 1102 if (j == 2) {
1103 scope = scope->inner_scope(); 1103 scope = scope->inner_scope();
1104 DCHECK_NOT_NULL(scope); 1104 DCHECK_NOT_NULL(scope);
1105 DCHECK_NULL(scope->sibling()); 1105 DCHECK_NULL(scope->sibling());
1106 } 1106 }
1107 CHECK_EQ((source_data[i].expected & ARGUMENTS) != 0, 1107 // Arrows themselves never get an arguments object.
1108 scope->uses_arguments()); 1108 if ((source_data[i].expected & ARGUMENTS) != 0 &&
1109 !scope->is_arrow_scope()) {
1110 CHECK_NOT_NULL(scope->arguments());
1111 }
1109 CHECK_EQ((source_data[i].expected & SUPER_PROPERTY) != 0, 1112 CHECK_EQ((source_data[i].expected & SUPER_PROPERTY) != 0,
1110 scope->uses_super_property()); 1113 scope->uses_super_property());
1111 if ((source_data[i].expected & THIS) != 0) { 1114 if ((source_data[i].expected & THIS) != 0) {
1112 // Currently the is_used() flag is conservative; all variables in a 1115 // Currently the is_used() flag is conservative; all variables in a
1113 // script scope are marked as used. 1116 // script scope are marked as used.
1114 CHECK( 1117 CHECK(
1115 scope->Lookup(info.ast_value_factory()->this_string())->is_used()); 1118 scope->Lookup(info.ast_value_factory()->this_string())->is_used());
1116 } 1119 }
1117 CHECK_EQ((source_data[i].expected & EVAL) != 0, scope->calls_eval()); 1120 CHECK_EQ((source_data[i].expected & EVAL) != 0, scope->calls_eval());
1118 } 1121 }
(...skipping 6836 matching lines...) Expand 10 before | Expand all | Expand 10 after
7955 "(a,);", 7958 "(a,);",
7956 "(a,b,c,);", 7959 "(a,b,c,);",
7957 NULL 7960 NULL
7958 }; 7961 };
7959 // clang-format on 7962 // clang-format on
7960 7963
7961 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; 7964 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas};
7962 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, 7965 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
7963 arraysize(always_flags)); 7966 arraysize(always_flags));
7964 } 7967 }
OLDNEW
« no previous file with comments | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698