| Index: src/ast.h
|
| diff --git a/src/ast.h b/src/ast.h
|
| index ed3a8b6ee34eb72a14975eb6dc6e22d5099ad39f..986ee905b29ffe15262f5641af473e560f7d0e10 100644
|
| --- a/src/ast.h
|
| +++ b/src/ast.h
|
| @@ -2312,6 +2312,11 @@ class FunctionLiteral V8_FINAL : public Expression {
|
| kNotGenerator
|
| };
|
|
|
| + enum IsArrowFlag {
|
| + kIsArrow,
|
| + kNotArrow
|
| + };
|
| +
|
| DECLARE_NODE_TYPE(FunctionLiteral)
|
|
|
| Handle<String> name() const { return name_; }
|
| @@ -2374,6 +2379,10 @@ class FunctionLiteral V8_FINAL : public Expression {
|
| return IsGenerator::decode(bitfield_) == kIsGenerator;
|
| }
|
|
|
| + bool is_arrow() {
|
| + return IsArrow::decode(bitfield_) == kIsArrow;
|
| + }
|
| +
|
| int ast_node_count() { return ast_properties_.node_count(); }
|
| AstProperties::Flags* flags() { return ast_properties_.flags(); }
|
| void set_ast_properties(AstProperties* ast_properties) {
|
| @@ -2408,6 +2417,7 @@ class FunctionLiteral V8_FINAL : public Expression {
|
| IsFunctionFlag is_function,
|
| IsParenthesizedFlag is_parenthesized,
|
| IsGeneratorFlag is_generator,
|
| + IsArrowFlag is_arrow,
|
| int position)
|
| : Expression(zone, position),
|
| name_(name),
|
| @@ -2427,7 +2437,8 @@ class FunctionLiteral V8_FINAL : public Expression {
|
| HasDuplicateParameters::encode(has_duplicate_parameters) |
|
| IsFunction::encode(is_function) |
|
| IsParenthesized::encode(is_parenthesized) |
|
| - IsGenerator::encode(is_generator);
|
| + IsGenerator::encode(is_generator) |
|
| + IsArrow::encode(is_arrow);
|
| }
|
|
|
| private:
|
| @@ -2454,6 +2465,7 @@ class FunctionLiteral V8_FINAL : public Expression {
|
| class IsFunction: public BitField<IsFunctionFlag, 4, 1> {};
|
| class IsParenthesized: public BitField<IsParenthesizedFlag, 5, 1> {};
|
| class IsGenerator: public BitField<IsGeneratorFlag, 6, 1> {};
|
| + class IsArrow: public BitField<IsArrowFlag, 7, 1> {};
|
| };
|
|
|
|
|
| @@ -3336,12 +3348,13 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED {
|
| FunctionLiteral::IsFunctionFlag is_function,
|
| FunctionLiteral::IsParenthesizedFlag is_parenthesized,
|
| FunctionLiteral::IsGeneratorFlag is_generator,
|
| + FunctionLiteral::IsArrowFlag is_arrow,
|
| int position) {
|
| FunctionLiteral* lit = new(zone_) FunctionLiteral(
|
| zone_, name, scope, body,
|
| materialized_literal_count, expected_property_count, handler_count,
|
| parameter_count, function_type, has_duplicate_parameters, is_function,
|
| - is_parenthesized, is_generator, position);
|
| + is_parenthesized, is_generator, is_arrow, position);
|
| // Top-level literal doesn't count for the AST's properties.
|
| if (is_function == FunctionLiteral::kIsFunction) {
|
| visitor_.VisitFunctionLiteral(lit);
|
|
|