OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 void VisitIllegalRedeclaration(AstVisitor* visitor); | 180 void VisitIllegalRedeclaration(AstVisitor* visitor); |
181 | 181 |
182 // Check if the scope has (at least) one illegal redeclaration. | 182 // Check if the scope has (at least) one illegal redeclaration. |
183 bool HasIllegalRedeclaration() const { return illegal_redecl_ != NULL; } | 183 bool HasIllegalRedeclaration() const { return illegal_redecl_ != NULL; } |
184 | 184 |
185 // For harmony block scoping mode: Check if the scope has conflicting var | 185 // For harmony block scoping mode: Check if the scope has conflicting var |
186 // declarations, i.e. a var declaration that has been hoisted from a nested | 186 // declarations, i.e. a var declaration that has been hoisted from a nested |
187 // scope over a let binding of the same name. | 187 // scope over a let binding of the same name. |
188 Declaration* CheckConflictingVarDeclarations(); | 188 Declaration* CheckConflictingVarDeclarations(); |
189 | 189 |
| 190 // For harmony block scoping mode: Check if the scope has variable proxies |
| 191 // that are used as lvalues and point to const variables. Assumes that scopes |
| 192 // have been analyzed and variables been resolved. |
| 193 VariableProxy* CheckAssignmentToConst(); |
| 194 |
190 // --------------------------------------------------------------------------- | 195 // --------------------------------------------------------------------------- |
191 // Scope-specific info. | 196 // Scope-specific info. |
192 | 197 |
193 // Inform the scope that the corresponding code contains a with statement. | 198 // Inform the scope that the corresponding code contains a with statement. |
194 void RecordWithStatement() { scope_contains_with_ = true; } | 199 void RecordWithStatement() { scope_contains_with_ = true; } |
195 | 200 |
196 // Inform the scope that the corresponding code contains an eval call. | 201 // Inform the scope that the corresponding code contains an eval call. |
197 void RecordEvalCall() { if (!is_global_scope()) scope_calls_eval_ = true; } | 202 void RecordEvalCall() { if (!is_global_scope()) scope_calls_eval_ = true; } |
198 | 203 |
199 // Set the strict mode flag (unless disabled by a global flag). | 204 // Set the strict mode flag (unless disabled by a global flag). |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 } | 556 } |
552 | 557 |
553 void SetDefaults(ScopeType type, | 558 void SetDefaults(ScopeType type, |
554 Scope* outer_scope, | 559 Scope* outer_scope, |
555 Handle<ScopeInfo> scope_info); | 560 Handle<ScopeInfo> scope_info); |
556 }; | 561 }; |
557 | 562 |
558 } } // namespace v8::internal | 563 } } // namespace v8::internal |
559 | 564 |
560 #endif // V8_SCOPES_H_ | 565 #endif // V8_SCOPES_H_ |
OLD | NEW |