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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 Scope* block_scope_; | 368 Scope* block_scope_; |
369 }; | 369 }; |
370 | 370 |
371 | 371 |
372 class Declaration: public AstNode { | 372 class Declaration: public AstNode { |
373 public: | 373 public: |
374 Declaration(VariableProxy* proxy, Variable::Mode mode, FunctionLiteral* fun) | 374 Declaration(VariableProxy* proxy, Variable::Mode mode, FunctionLiteral* fun) |
375 : proxy_(proxy), | 375 : proxy_(proxy), |
376 mode_(mode), | 376 mode_(mode), |
377 fun_(fun) { | 377 fun_(fun) { |
378 ASSERT(mode == Variable::VAR || mode == Variable::CONST); | 378 ASSERT(mode == Variable::VAR || |
| 379 mode == Variable::CONST || |
| 380 mode == Variable::LET); |
379 // At the moment there are no "const functions"'s in JavaScript... | 381 // At the moment there are no "const functions"'s in JavaScript... |
380 ASSERT(fun == NULL || mode == Variable::VAR); | 382 ASSERT(fun == NULL || mode == Variable::VAR || mode == Variable::LET); |
381 } | 383 } |
382 | 384 |
383 DECLARE_NODE_TYPE(Declaration) | 385 DECLARE_NODE_TYPE(Declaration) |
384 | 386 |
385 VariableProxy* proxy() const { return proxy_; } | 387 VariableProxy* proxy() const { return proxy_; } |
386 Variable::Mode mode() const { return mode_; } | 388 Variable::Mode mode() const { return mode_; } |
387 FunctionLiteral* fun() const { return fun_; } // may be NULL | 389 FunctionLiteral* fun() const { return fun_; } // may be NULL |
388 virtual bool IsInlineable() const; | 390 virtual bool IsInlineable() const; |
389 | 391 |
390 private: | 392 private: |
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2242 | 2244 |
2243 private: | 2245 private: |
2244 Isolate* isolate_; | 2246 Isolate* isolate_; |
2245 bool stack_overflow_; | 2247 bool stack_overflow_; |
2246 }; | 2248 }; |
2247 | 2249 |
2248 | 2250 |
2249 } } // namespace v8::internal | 2251 } } // namespace v8::internal |
2250 | 2252 |
2251 #endif // V8_AST_H_ | 2253 #endif // V8_AST_H_ |
OLD | NEW |