Chromium Code Reviews| Index: src/preparser.h |
| diff --git a/src/preparser.h b/src/preparser.h |
| index 1b9af9e732600c75d36b9f3e14d8919e0f3e7bae..d2cd1738b31b1cdd145771c08af479a7db833ccc 100644 |
| --- a/src/preparser.h |
| +++ b/src/preparser.h |
| @@ -2148,6 +2148,10 @@ ParserBase<Traits>::ParsePropertyDefinition(ObjectLiteralCheckerBase* checker, |
| : FunctionKind::kBaseConstructor; |
| } |
| + if (!in_class) { |
| + kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); |
|
Dmitry Lomov (no reviews)
2015/03/10 16:06:01
Add function:
FunctionKind WithObjectLiteralBit(
marja
2015/03/10 16:17:38
Done.
|
| + } |
| + |
| value = this->ParseFunctionLiteral( |
| name, scanner()->location(), |
| false, // reserved words are allowed here |
| @@ -2179,11 +2183,14 @@ ParserBase<Traits>::ParsePropertyDefinition(ObjectLiteralCheckerBase* checker, |
| CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); |
| } |
| + FunctionKind kind = FunctionKind::kAccessorFunction; |
| + if (!in_class) { |
| + kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); |
|
Dmitry Lomov (no reviews)
2015/03/10 16:06:01
Ditto.
marja
2015/03/10 16:17:38
Done.
|
| + } |
| typename Traits::Type::FunctionLiteral value = this->ParseFunctionLiteral( |
| name, scanner()->location(), |
| false, // reserved words are allowed here |
| - FunctionKind::kAccessorFunction, RelocInfo::kNoPosition, |
| - FunctionLiteral::ANONYMOUS_EXPRESSION, |
| + kind, RelocInfo::kNoPosition, FunctionLiteral::ANONYMOUS_EXPRESSION, |
| is_get ? FunctionLiteral::GETTER_ARITY : FunctionLiteral::SETTER_ARITY, |
| CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); |