Index: src/preparser.h |
diff --git a/src/preparser.h b/src/preparser.h |
index 1b9af9e732600c75d36b9f3e14d8919e0f3e7bae..054a33c640bd7b6b8f503d631f117e9427a5510e 100644 |
--- a/src/preparser.h |
+++ b/src/preparser.h |
@@ -2148,6 +2148,8 @@ ParserBase<Traits>::ParsePropertyDefinition(ObjectLiteralCheckerBase* checker, |
: FunctionKind::kBaseConstructor; |
} |
+ if (!in_class) kind = WithObjectLiteralBit(kind); |
+ |
value = this->ParseFunctionLiteral( |
name, scanner()->location(), |
false, // reserved words are allowed here |
@@ -2179,11 +2181,12 @@ ParserBase<Traits>::ParsePropertyDefinition(ObjectLiteralCheckerBase* checker, |
CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); |
} |
+ FunctionKind kind = FunctionKind::kAccessorFunction; |
+ if (!in_class) kind = WithObjectLiteralBit(kind); |
arv (Not doing code reviews)
2015/03/10 16:49:06
It is not clear to me that we need this extra bit.
marja
2015/03/10 17:08:13
Scope-wise, a method (or an accessor) of an object
|
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)); |