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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 void set_end_position(int statement_pos) { | 256 void set_end_position(int statement_pos) { |
257 end_position_ = statement_pos; | 257 end_position_ = statement_pos; |
258 } | 258 } |
259 | 259 |
260 // --------------------------------------------------------------------------- | 260 // --------------------------------------------------------------------------- |
261 // Predicates. | 261 // Predicates. |
262 | 262 |
263 // Specific scope types. | 263 // Specific scope types. |
264 bool is_eval_scope() const { return type_ == EVAL_SCOPE; } | 264 bool is_eval_scope() const { return type_ == EVAL_SCOPE; } |
265 bool is_function_scope() const { return type_ == FUNCTION_SCOPE; } | 265 bool is_function_scope() const { return type_ == FUNCTION_SCOPE; } |
| 266 bool is_module_scope() const { return type_ == MODULE_SCOPE; } |
266 bool is_global_scope() const { return type_ == GLOBAL_SCOPE; } | 267 bool is_global_scope() const { return type_ == GLOBAL_SCOPE; } |
267 bool is_catch_scope() const { return type_ == CATCH_SCOPE; } | 268 bool is_catch_scope() const { return type_ == CATCH_SCOPE; } |
268 bool is_block_scope() const { return type_ == BLOCK_SCOPE; } | 269 bool is_block_scope() const { return type_ == BLOCK_SCOPE; } |
269 bool is_with_scope() const { return type_ == WITH_SCOPE; } | 270 bool is_with_scope() const { return type_ == WITH_SCOPE; } |
270 bool is_declaration_scope() const { | 271 bool is_declaration_scope() const { |
271 return is_eval_scope() || is_function_scope() || is_global_scope(); | 272 return is_eval_scope() || is_function_scope() || is_global_scope(); |
272 } | 273 } |
273 bool is_classic_mode() const { | 274 bool is_classic_mode() const { |
274 return language_mode() == CLASSIC_MODE; | 275 return language_mode() == CLASSIC_MODE; |
275 } | 276 } |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 } | 581 } |
581 | 582 |
582 void SetDefaults(ScopeType type, | 583 void SetDefaults(ScopeType type, |
583 Scope* outer_scope, | 584 Scope* outer_scope, |
584 Handle<ScopeInfo> scope_info); | 585 Handle<ScopeInfo> scope_info); |
585 }; | 586 }; |
586 | 587 |
587 } } // namespace v8::internal | 588 } } // namespace v8::internal |
588 | 589 |
589 #endif // V8_SCOPES_H_ | 590 #endif // V8_SCOPES_H_ |
OLD | NEW |