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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 CHECK_EQ(1, scope->inner_scopes()->length()); | 1084 CHECK_EQ(1, scope->inner_scopes()->length()); |
1085 scope = scope->inner_scopes()->at(0); | 1085 scope = scope->inner_scopes()->at(0); |
1086 } | 1086 } |
1087 CHECK_EQ((source_data[i].expected & ARGUMENTS) != 0, | 1087 CHECK_EQ((source_data[i].expected & ARGUMENTS) != 0, |
1088 scope->uses_arguments()); | 1088 scope->uses_arguments()); |
1089 CHECK_EQ((source_data[i].expected & SUPER_PROPERTY) != 0, | 1089 CHECK_EQ((source_data[i].expected & SUPER_PROPERTY) != 0, |
1090 scope->uses_super_property()); | 1090 scope->uses_super_property()); |
1091 if ((source_data[i].expected & THIS) != 0) { | 1091 if ((source_data[i].expected & THIS) != 0) { |
1092 // Currently the is_used() flag is conservative; all variables in a | 1092 // Currently the is_used() flag is conservative; all variables in a |
1093 // script scope are marked as used. | 1093 // script scope are marked as used. |
1094 CHECK(scope->LookupThis()->is_used()); | 1094 CHECK( |
| 1095 scope->Lookup(info.ast_value_factory()->this_string())->is_used()); |
1095 } | 1096 } |
1096 CHECK_EQ((source_data[i].expected & EVAL) != 0, scope->calls_eval()); | 1097 CHECK_EQ((source_data[i].expected & EVAL) != 0, scope->calls_eval()); |
1097 } | 1098 } |
1098 } | 1099 } |
1099 } | 1100 } |
1100 | 1101 |
1101 | 1102 |
1102 static void CheckParsesToNumber(const char* source, bool with_dot) { | 1103 static void CheckParsesToNumber(const char* source, bool with_dot) { |
1103 v8::V8::Initialize(); | 1104 v8::V8::Initialize(); |
1104 HandleAndZoneScope handles; | 1105 HandleAndZoneScope handles; |
(...skipping 6122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7227 NULL | 7228 NULL |
7228 }; | 7229 }; |
7229 // clang-format on | 7230 // clang-format on |
7230 | 7231 |
7231 static const ParserFlag fail_flags[] = { | 7232 static const ParserFlag fail_flags[] = { |
7232 kAllowHarmonySloppy, kAllowHarmonySloppyLet, kNoLegacyConst, | 7233 kAllowHarmonySloppy, kAllowHarmonySloppyLet, kNoLegacyConst, |
7233 kAllowHarmonyDestructuring}; | 7234 kAllowHarmonyDestructuring}; |
7234 RunParserSyncTest(context_data, fail_data, kError, NULL, 0, fail_flags, | 7235 RunParserSyncTest(context_data, fail_data, kError, NULL, 0, fail_flags, |
7235 arraysize(fail_flags)); | 7236 arraysize(fail_flags)); |
7236 } | 7237 } |
OLD | NEW |