| 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_PARSING_PARSER_BASE_H | 5 #ifndef V8_PARSING_PARSER_BASE_H |
| 6 #define V8_PARSING_PARSER_BASE_H | 6 #define V8_PARSING_PARSER_BASE_H |
| 7 | 7 |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
| 10 #include "src/hashmap.h" | 10 #include "src/hashmap.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 bool is_generator() const { return IsGeneratorFunction(kind_); } | 254 bool is_generator() const { return IsGeneratorFunction(kind_); } |
| 255 bool is_async_function() const { return IsAsyncFunction(kind_); } | 255 bool is_async_function() const { return IsAsyncFunction(kind_); } |
| 256 | 256 |
| 257 FunctionKind kind() const { return kind_; } | 257 FunctionKind kind() const { return kind_; } |
| 258 FunctionState* outer() const { return outer_function_state_; } | 258 FunctionState* outer() const { return outer_function_state_; } |
| 259 | 259 |
| 260 void set_generator_object_variable( | 260 void set_generator_object_variable( |
| 261 typename Traits::Type::GeneratorVariable* variable) { | 261 typename Traits::Type::GeneratorVariable* variable) { |
| 262 DCHECK(variable != NULL); | 262 DCHECK(variable != NULL); |
| 263 DCHECK(is_generator()); | 263 DCHECK(is_generator() || is_async_function()); |
| 264 generator_object_variable_ = variable; | 264 generator_object_variable_ = variable; |
| 265 } | 265 } |
| 266 typename Traits::Type::GeneratorVariable* generator_object_variable() | 266 typename Traits::Type::GeneratorVariable* generator_object_variable() |
| 267 const { | 267 const { |
| 268 return generator_object_variable_; | 268 return generator_object_variable_; |
| 269 } | 269 } |
| 270 | 270 |
| 271 typename Traits::Type::Factory* factory() { return factory_; } | 271 typename Traits::Type::Factory* factory() { return factory_; } |
| 272 | 272 |
| 273 const List<DestructuringAssignment>& destructuring_assignments_to_rewrite() | 273 const List<DestructuringAssignment>& destructuring_assignments_to_rewrite() |
| (...skipping 2963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3237 has_seen_constructor_ = true; | 3237 has_seen_constructor_ = true; |
| 3238 return; | 3238 return; |
| 3239 } | 3239 } |
| 3240 } | 3240 } |
| 3241 | 3241 |
| 3242 | 3242 |
| 3243 } // namespace internal | 3243 } // namespace internal |
| 3244 } // namespace v8 | 3244 } // namespace v8 |
| 3245 | 3245 |
| 3246 #endif // V8_PARSING_PARSER_BASE_H | 3246 #endif // V8_PARSING_PARSER_BASE_H |
| OLD | NEW |