OLD | NEW |
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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 scope = scope->inner_scope(); | 1132 scope = scope->inner_scope(); |
1133 DCHECK_NOT_NULL(scope); | 1133 DCHECK_NOT_NULL(scope); |
1134 DCHECK_NULL(scope->sibling()); | 1134 DCHECK_NULL(scope->sibling()); |
1135 } | 1135 } |
1136 // Arrows themselves never get an arguments object. | 1136 // Arrows themselves never get an arguments object. |
1137 if ((source_data[i].expected & ARGUMENTS) != 0 && | 1137 if ((source_data[i].expected & ARGUMENTS) != 0 && |
1138 !scope->AsDeclarationScope()->is_arrow_scope()) { | 1138 !scope->AsDeclarationScope()->is_arrow_scope()) { |
1139 CHECK_NOT_NULL(scope->AsDeclarationScope()->arguments()); | 1139 CHECK_NOT_NULL(scope->AsDeclarationScope()->arguments()); |
1140 } | 1140 } |
1141 CHECK_EQ((source_data[i].expected & SUPER_PROPERTY) != 0, | 1141 CHECK_EQ((source_data[i].expected & SUPER_PROPERTY) != 0, |
1142 scope->uses_super_property()); | 1142 scope->AsDeclarationScope()->uses_super_property()); |
1143 if ((source_data[i].expected & THIS) != 0) { | 1143 if ((source_data[i].expected & THIS) != 0) { |
1144 // Currently the is_used() flag is conservative; all variables in a | 1144 // Currently the is_used() flag is conservative; all variables in a |
1145 // script scope are marked as used. | 1145 // script scope are marked as used. |
1146 CHECK( | 1146 CHECK( |
1147 scope->Lookup(info.ast_value_factory()->this_string())->is_used()); | 1147 scope->Lookup(info.ast_value_factory()->this_string())->is_used()); |
1148 } | 1148 } |
1149 CHECK_EQ((source_data[i].expected & EVAL) != 0, scope->calls_eval()); | 1149 CHECK_EQ((source_data[i].expected & EVAL) != 0, scope->calls_eval()); |
1150 } | 1150 } |
1151 } | 1151 } |
1152 } | 1152 } |
(...skipping 7057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8210 "(a,);", | 8210 "(a,);", |
8211 "(a,b,c,);", | 8211 "(a,b,c,);", |
8212 NULL | 8212 NULL |
8213 }; | 8213 }; |
8214 // clang-format on | 8214 // clang-format on |
8215 | 8215 |
8216 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; | 8216 static const ParserFlag always_flags[] = {kAllowHarmonyTrailingCommas}; |
8217 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, | 8217 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
8218 arraysize(always_flags)); | 8218 arraysize(always_flags)); |
8219 } | 8219 } |
OLD | NEW |