| Index: src/preparser.h
|
| diff --git a/src/preparser.h b/src/preparser.h
|
| index 499240e63acc6b43bdcefd74edc183113600f432..8419811e649f83683894a05d0dcfe6af0996bd9e 100644
|
| --- a/src/preparser.h
|
| +++ b/src/preparser.h
|
| @@ -471,39 +471,6 @@ class ParserBase : public Traits {
|
| kValueFlag = 4
|
| };
|
|
|
| - // Validation per ECMA 262 - 11.1.5 "Object Initialiser".
|
| - class ObjectLiteralChecker {
|
| - public:
|
| - ObjectLiteralChecker(ParserBase* parser, StrictMode strict_mode)
|
| - : parser_(parser),
|
| - finder_(scanner()->unicode_cache()),
|
| - strict_mode_(strict_mode) { }
|
| -
|
| - void CheckProperty(Token::Value property, PropertyKind type, bool* ok);
|
| -
|
| - private:
|
| - ParserBase* parser() const { return parser_; }
|
| - Scanner* scanner() const { return parser_->scanner(); }
|
| -
|
| - // Checks the type of conflict based on values coming from PropertyType.
|
| - bool HasConflict(PropertyKind type1, PropertyKind type2) {
|
| - return (type1 & type2) != 0;
|
| - }
|
| - bool IsDataDataConflict(PropertyKind type1, PropertyKind type2) {
|
| - return ((type1 & type2) & kValueFlag) != 0;
|
| - }
|
| - bool IsDataAccessorConflict(PropertyKind type1, PropertyKind type2) {
|
| - return ((type1 ^ type2) & kValueFlag) != 0;
|
| - }
|
| - bool IsAccessorAccessorConflict(PropertyKind type1, PropertyKind type2) {
|
| - return ((type1 | type2) & kValueFlag) == 0;
|
| - }
|
| -
|
| - ParserBase* parser_;
|
| - DuplicateFinder finder_;
|
| - StrictMode strict_mode_;
|
| - };
|
| -
|
| // If true, the next (and immediately following) function literal is
|
| // preceded by a parenthesis.
|
| // Heuristically that means that the function will be called immediately,
|
| @@ -1551,8 +1518,6 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseObjectLiteral(
|
| int number_of_boilerplate_properties = 0;
|
| bool has_function = false;
|
|
|
| - ObjectLiteralChecker checker(this, strict_mode());
|
| -
|
| Expect(Token::LBRACE, CHECK_OK);
|
|
|
| while (peek() != Token::RBRACE) {
|
| @@ -1587,9 +1552,6 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseObjectLiteral(
|
| *ok = false;
|
| return this->EmptyLiteral();
|
| }
|
| - // Validate the property.
|
| - PropertyKind type = is_getter ? kGetterProperty : kSetterProperty;
|
| - checker.CheckProperty(next, type, CHECK_OK);
|
| IdentifierT name = this->GetSymbol(scanner_);
|
| typename Traits::Type::FunctionLiteral value =
|
| this->ParseFunctionLiteral(
|
| @@ -1653,9 +1615,6 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseObjectLiteral(
|
| }
|
| }
|
|
|
| - // Validate the property
|
| - checker.CheckProperty(next, kValueProperty, CHECK_OK);
|
| -
|
| Expect(Token::COLON, CHECK_OK);
|
| ExpressionT value = this->ParseAssignmentExpression(true, CHECK_OK);
|
|
|
| @@ -2180,36 +2139,6 @@ ParserBase<Traits>::CheckAndRewriteReferenceExpression(
|
| #undef CHECK_OK_CUSTOM
|
|
|
|
|
| -template <typename Traits>
|
| -void ParserBase<Traits>::ObjectLiteralChecker::CheckProperty(
|
| - Token::Value property,
|
| - PropertyKind type,
|
| - bool* ok) {
|
| - int old;
|
| - if (property == Token::NUMBER) {
|
| - old = scanner()->FindNumber(&finder_, type);
|
| - } else {
|
| - old = scanner()->FindSymbol(&finder_, type);
|
| - }
|
| - PropertyKind old_type = static_cast<PropertyKind>(old);
|
| - if (HasConflict(old_type, type)) {
|
| - if (IsDataDataConflict(old_type, type)) {
|
| - // Both are data properties.
|
| - if (strict_mode_ == SLOPPY) return;
|
| - parser()->ReportMessage("strict_duplicate_property");
|
| - } else if (IsDataAccessorConflict(old_type, type)) {
|
| - // Both a data and an accessor property with the same name.
|
| - parser()->ReportMessage("accessor_data_property");
|
| - } else {
|
| - ASSERT(IsAccessorAccessorConflict(old_type, type));
|
| - // Both accessors of the same type.
|
| - parser()->ReportMessage("accessor_get_set");
|
| - }
|
| - *ok = false;
|
| - }
|
| -}
|
| -
|
| -
|
| } } // v8::internal
|
|
|
| #endif // V8_PREPARSER_H
|
|
|