diff options
Diffstat (limited to 'deps/v8/src/ast/ast.cc')
-rw-r--r-- | deps/v8/src/ast/ast.cc | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/deps/v8/src/ast/ast.cc b/deps/v8/src/ast/ast.cc index 7d2227e2c8..a930a374b8 100644 --- a/deps/v8/src/ast/ast.cc +++ b/deps/v8/src/ast/ast.cc @@ -12,17 +12,17 @@ #include "src/base/hashmap.h" #include "src/builtins/builtins-constructor.h" #include "src/builtins/builtins.h" -#include "src/contexts.h" -#include "src/conversions-inl.h" -#include "src/double.h" -#include "src/elements.h" -#include "src/objects-inl.h" +#include "src/numbers/conversions-inl.h" +#include "src/numbers/double.h" +#include "src/objects/contexts.h" +#include "src/objects/elements.h" #include "src/objects/literal-objects-inl.h" #include "src/objects/literal-objects.h" #include "src/objects/map.h" -#include "src/property-details.h" -#include "src/property.h" -#include "src/string-stream.h" +#include "src/objects/objects-inl.h" +#include "src/objects/property-details.h" +#include "src/objects/property.h" +#include "src/strings/string-stream.h" #include "src/zone/zone-list-inl.h" namespace v8 { @@ -282,6 +282,17 @@ std::unique_ptr<char[]> FunctionLiteral::GetDebugName() const { return result; } +bool FunctionLiteral::requires_brand_initialization() const { + Scope* outer = scope_->outer_scope(); + + // If there are no variables declared in the outer scope other than + // the class name variable, the outer class scope may be elided when + // the function is deserialized after preparsing. + if (!outer->is_class_scope()) return false; + + return outer->AsClassScope()->brand() != nullptr; +} + ObjectLiteralProperty::ObjectLiteralProperty(Expression* key, Expression* value, Kind kind, bool is_computed_name) : LiteralProperty(key, value, is_computed_name), |