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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 private: | 391 private: |
392 ZoneList<Statement*> statements_; | 392 ZoneList<Statement*> statements_; |
393 bool is_initializer_block_; | 393 bool is_initializer_block_; |
394 Scope* block_scope_; | 394 Scope* block_scope_; |
395 }; | 395 }; |
396 | 396 |
397 | 397 |
398 class Declaration: public AstNode { | 398 class Declaration: public AstNode { |
399 public: | 399 public: |
400 Declaration(VariableProxy* proxy, | 400 Declaration(VariableProxy* proxy, |
401 Variable::Mode mode, | 401 VariableMode mode, |
402 FunctionLiteral* fun, | 402 FunctionLiteral* fun, |
403 Scope* scope) | 403 Scope* scope) |
404 : proxy_(proxy), | 404 : proxy_(proxy), |
405 mode_(mode), | 405 mode_(mode), |
406 fun_(fun), | 406 fun_(fun), |
407 scope_(scope) { | 407 scope_(scope) { |
408 ASSERT(mode == Variable::VAR || | 408 ASSERT(mode == VAR || mode == CONST || mode == LET); |
409 mode == Variable::CONST || | |
410 mode == Variable::LET); | |
411 // At the moment there are no "const functions"'s in JavaScript... | 409 // At the moment there are no "const functions"'s in JavaScript... |
412 ASSERT(fun == NULL || mode == Variable::VAR || mode == Variable::LET); | 410 ASSERT(fun == NULL || mode == VAR || mode == LET); |
413 } | 411 } |
414 | 412 |
415 DECLARE_NODE_TYPE(Declaration) | 413 DECLARE_NODE_TYPE(Declaration) |
416 | 414 |
417 VariableProxy* proxy() const { return proxy_; } | 415 VariableProxy* proxy() const { return proxy_; } |
418 Variable::Mode mode() const { return mode_; } | 416 VariableMode mode() const { return mode_; } |
419 FunctionLiteral* fun() const { return fun_; } // may be NULL | 417 FunctionLiteral* fun() const { return fun_; } // may be NULL |
420 virtual bool IsInlineable() const; | 418 virtual bool IsInlineable() const; |
421 Scope* scope() const { return scope_; } | 419 Scope* scope() const { return scope_; } |
422 | 420 |
423 private: | 421 private: |
424 VariableProxy* proxy_; | 422 VariableProxy* proxy_; |
425 Variable::Mode mode_; | 423 VariableMode mode_; |
426 FunctionLiteral* fun_; | 424 FunctionLiteral* fun_; |
427 | 425 |
428 // Nested scope from which the declaration originated. | 426 // Nested scope from which the declaration originated. |
429 Scope* scope_; | 427 Scope* scope_; |
430 }; | 428 }; |
431 | 429 |
432 | 430 |
433 class IterationStatement: public BreakableStatement { | 431 class IterationStatement: public BreakableStatement { |
434 public: | 432 public: |
435 // Type testing & conversion. | 433 // Type testing & conversion. |
(...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2129 | 2127 |
2130 private: | 2128 private: |
2131 Isolate* isolate_; | 2129 Isolate* isolate_; |
2132 bool stack_overflow_; | 2130 bool stack_overflow_; |
2133 }; | 2131 }; |
2134 | 2132 |
2135 | 2133 |
2136 } } // namespace v8::internal | 2134 } } // namespace v8::internal |
2137 | 2135 |
2138 #endif // V8_AST_H_ | 2136 #endif // V8_AST_H_ |
OLD | NEW |