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

Side by Side Diff: src/scopes.h

Issue 6883200: Strict mode eval declares its locals in its own environment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/parser.cc ('k') | test/mjsunit/strict-mode.js » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 } 204 }
205 205
206 // --------------------------------------------------------------------------- 206 // ---------------------------------------------------------------------------
207 // Predicates. 207 // Predicates.
208 208
209 // Specific scope types. 209 // Specific scope types.
210 bool is_eval_scope() const { return type_ == EVAL_SCOPE; } 210 bool is_eval_scope() const { return type_ == EVAL_SCOPE; }
211 bool is_function_scope() const { return type_ == FUNCTION_SCOPE; } 211 bool is_function_scope() const { return type_ == FUNCTION_SCOPE; }
212 bool is_global_scope() const { return type_ == GLOBAL_SCOPE; } 212 bool is_global_scope() const { return type_ == GLOBAL_SCOPE; }
213 bool is_strict_mode() const { return strict_mode_; } 213 bool is_strict_mode() const { return strict_mode_; }
214 bool is_strict_mode_eval_scope() const {
215 return is_eval_scope() && is_strict_mode();
216 }
214 217
215 // Information about which scopes calls eval. 218 // Information about which scopes calls eval.
216 bool calls_eval() const { return scope_calls_eval_; } 219 bool calls_eval() const { return scope_calls_eval_; }
217 bool outer_scope_calls_eval() const { return outer_scope_calls_eval_; } 220 bool outer_scope_calls_eval() const { return outer_scope_calls_eval_; }
218 221
219 // Is this scope inside a with statement. 222 // Is this scope inside a with statement.
220 bool inside_with() const { return scope_inside_with_; } 223 bool inside_with() const { return scope_inside_with_; }
221 // Does this scope contain a with statement. 224 // Does this scope contain a with statement.
222 bool contains_with() const { return scope_contains_with_; } 225 bool contains_with() const { return scope_contains_with_; }
223 226
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 int nesting_level_; 480 int nesting_level_;
478 // Nesting level of outermost scope that is contained in a with statement, 481 // Nesting level of outermost scope that is contained in a with statement,
479 // or kNotInsideWith if there are no with's around the current scope. 482 // or kNotInsideWith if there are no with's around the current scope.
480 int inside_with_level_; 483 int inside_with_level_;
481 }; 484 };
482 485
483 486
484 } } // namespace v8::internal 487 } } // namespace v8::internal
485 488
486 #endif // V8_SCOPES_H_ 489 #endif // V8_SCOPES_H_
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | test/mjsunit/strict-mode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698