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

Side by Side Diff: src/scopes.h

Issue 11607016: Simplify implementation of assignment-to-const checks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « src/parser.cc ('k') | src/scopes.cc » ('j') | 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 void VisitIllegalRedeclaration(AstVisitor* visitor); 217 void VisitIllegalRedeclaration(AstVisitor* visitor);
218 218
219 // Check if the scope has (at least) one illegal redeclaration. 219 // Check if the scope has (at least) one illegal redeclaration.
220 bool HasIllegalRedeclaration() const { return illegal_redecl_ != NULL; } 220 bool HasIllegalRedeclaration() const { return illegal_redecl_ != NULL; }
221 221
222 // For harmony block scoping mode: Check if the scope has conflicting var 222 // For harmony block scoping mode: Check if the scope has conflicting var
223 // declarations, i.e. a var declaration that has been hoisted from a nested 223 // declarations, i.e. a var declaration that has been hoisted from a nested
224 // scope over a let binding of the same name. 224 // scope over a let binding of the same name.
225 Declaration* CheckConflictingVarDeclarations(); 225 Declaration* CheckConflictingVarDeclarations();
226 226
227 // For harmony block scoping mode: Check if the scope has variable proxies
228 // that are used as lvalues and point to const variables. Assumes that scopes
229 // have been analyzed and variables been resolved.
230 VariableProxy* CheckAssignmentToConst();
231
232 // --------------------------------------------------------------------------- 227 // ---------------------------------------------------------------------------
233 // Scope-specific info. 228 // Scope-specific info.
234 229
235 // Inform the scope that the corresponding code contains a with statement. 230 // Inform the scope that the corresponding code contains a with statement.
236 void RecordWithStatement() { scope_contains_with_ = true; } 231 void RecordWithStatement() { scope_contains_with_ = true; }
237 232
238 // Inform the scope that the corresponding code contains an eval call. 233 // Inform the scope that the corresponding code contains an eval call.
239 void RecordEvalCall() { if (!is_global_scope()) scope_calls_eval_ = true; } 234 void RecordEvalCall() { if (!is_global_scope()) scope_calls_eval_ = true; }
240 235
241 // Set the strict mode flag (unless disabled by a global flag). 236 // Set the strict mode flag (unless disabled by a global flag).
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 void SetDefaults(ScopeType type, 628 void SetDefaults(ScopeType type,
634 Scope* outer_scope, 629 Scope* outer_scope,
635 Handle<ScopeInfo> scope_info); 630 Handle<ScopeInfo> scope_info);
636 631
637 Zone* zone_; 632 Zone* zone_;
638 }; 633 };
639 634
640 } } // namespace v8::internal 635 } } // namespace v8::internal
641 636
642 #endif // V8_SCOPES_H_ 637 #endif // V8_SCOPES_H_
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698