| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
| 6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast-value-factory.h" | 8 #include "src/ast/ast-value-factory.h" |
| 9 #include "src/ast/modules.h" | 9 #include "src/ast/modules.h" |
| 10 #include "src/ast/variables.h" | 10 #include "src/ast/variables.h" |
| (...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1180 | 1180 |
| 1181 // Delegates to another statement, which may be overwritten. | 1181 // Delegates to another statement, which may be overwritten. |
| 1182 // This was introduced to implement ES2015 Annex B3.3 for conditionally making | 1182 // This was introduced to implement ES2015 Annex B3.3 for conditionally making |
| 1183 // sloppy-mode block-scoped functions have a var binding, which is changed | 1183 // sloppy-mode block-scoped functions have a var binding, which is changed |
| 1184 // from one statement to another during parsing. | 1184 // from one statement to another during parsing. |
| 1185 class SloppyBlockFunctionStatement final : public Statement { | 1185 class SloppyBlockFunctionStatement final : public Statement { |
| 1186 public: | 1186 public: |
| 1187 Statement* statement() const { return statement_; } | 1187 Statement* statement() const { return statement_; } |
| 1188 void set_statement(Statement* statement) { statement_ = statement; } | 1188 void set_statement(Statement* statement) { statement_ = statement; } |
| 1189 Scope* scope() const { return scope_; } | 1189 Scope* scope() const { return scope_; } |
| 1190 SloppyBlockFunctionStatement* next() { return next_; } |
| 1191 void set_next(SloppyBlockFunctionStatement* next) { next_ = next; } |
| 1190 | 1192 |
| 1191 private: | 1193 private: |
| 1192 friend class AstNodeFactory; | 1194 friend class AstNodeFactory; |
| 1193 | 1195 |
| 1194 SloppyBlockFunctionStatement(Zone* zone, Statement* statement, Scope* scope) | 1196 SloppyBlockFunctionStatement(Zone* zone, Statement* statement, Scope* scope) |
| 1195 : Statement(zone, kNoSourcePosition, kSloppyBlockFunctionStatement), | 1197 : Statement(zone, kNoSourcePosition, kSloppyBlockFunctionStatement), |
| 1196 statement_(statement), | 1198 statement_(statement), |
| 1197 scope_(scope) {} | 1199 scope_(scope), |
| 1200 next_(nullptr) {} |
| 1198 | 1201 |
| 1199 Statement* statement_; | 1202 Statement* statement_; |
| 1200 Scope* const scope_; | 1203 Scope* const scope_; |
| 1204 SloppyBlockFunctionStatement* next_; |
| 1201 }; | 1205 }; |
| 1202 | 1206 |
| 1203 | 1207 |
| 1204 class Literal final : public Expression { | 1208 class Literal final : public Expression { |
| 1205 public: | 1209 public: |
| 1206 bool IsPropertyName() const { return value_->IsPropertyName(); } | 1210 bool IsPropertyName() const { return value_->IsPropertyName(); } |
| 1207 | 1211 |
| 1208 Handle<String> AsPropertyName() { | 1212 Handle<String> AsPropertyName() { |
| 1209 DCHECK(IsPropertyName()); | 1213 DCHECK(IsPropertyName()); |
| 1210 return Handle<String>::cast(value()); | 1214 return Handle<String>::cast(value()); |
| (...skipping 2276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3487 : NULL; \ | 3491 : NULL; \ |
| 3488 } | 3492 } |
| 3489 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3493 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3490 #undef DECLARE_NODE_FUNCTIONS | 3494 #undef DECLARE_NODE_FUNCTIONS |
| 3491 | 3495 |
| 3492 | 3496 |
| 3493 } // namespace internal | 3497 } // namespace internal |
| 3494 } // namespace v8 | 3498 } // namespace v8 |
| 3495 | 3499 |
| 3496 #endif // V8_AST_AST_H_ | 3500 #endif // V8_AST_AST_H_ |
| OLD | NEW |