summaryrefslogtreecommitdiff
path: root/chromium/v8/src/parsing/preparser.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-06-02 10:15:40 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-06-02 08:41:08 +0000
commitb92421879c003a0857b2074f7e05b3bbbb326569 (patch)
treebdfd21ad74690ae4069e4a055191844994027b78 /chromium/v8/src/parsing/preparser.cc
parent980b784afe75be22158126ac6a639c19459d3427 (diff)
downloadqtwebengine-chromium-b92421879c003a0857b2074f7e05b3bbbb326569.tar.gz
BASELINE: Update Chromium to 51.0.2704.79
Also adds a few files for url_parsing in extensions. Change-Id: Ie4820c3da75f0a56b3cc86dccc077d671227077b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'chromium/v8/src/parsing/preparser.cc')
-rw-r--r--chromium/v8/src/parsing/preparser.cc38
1 files changed, 23 insertions, 15 deletions
diff --git a/chromium/v8/src/parsing/preparser.cc b/chromium/v8/src/parsing/preparser.cc
index 613651a3b1a..da1c35bcc06 100644
--- a/chromium/v8/src/parsing/preparser.cc
+++ b/chromium/v8/src/parsing/preparser.cc
@@ -135,11 +135,11 @@ PreParser::PreParseResult PreParser::PreParseLazyFunction(
return kPreParseSuccess;
}
-
PreParserExpression PreParserTraits::ParseClassLiteral(
- PreParserIdentifier name, Scanner::Location class_name_location,
- bool name_is_strict_reserved, int pos, bool* ok) {
- return pre_parser_->ParseClassLiteral(name, class_name_location,
+ Type::ExpressionClassifier* classifier, PreParserIdentifier name,
+ Scanner::Location class_name_location, bool name_is_strict_reserved,
+ int pos, bool* ok) {
+ return pre_parser_->ParseClassLiteral(classifier, name, class_name_location,
name_is_strict_reserved, pos, ok);
}
@@ -413,8 +413,8 @@ PreParser::Statement PreParser::ParseClassDeclaration(bool* ok) {
bool is_strict_reserved = false;
Identifier name =
ParseIdentifierOrStrictReservedWord(&is_strict_reserved, CHECK_OK);
- ParseClassLiteral(name, scanner()->location(), is_strict_reserved, pos,
- CHECK_OK);
+ ParseClassLiteral(nullptr, name, scanner()->location(), is_strict_reserved,
+ pos, CHECK_OK);
return Statement::Default();
}
@@ -1061,10 +1061,10 @@ void PreParser::ParseLazyFunctionLiteralBody(bool* ok,
scope_->uses_super_property(), scope_->calls_eval());
}
-
PreParserExpression PreParser::ParseClassLiteral(
- PreParserIdentifier name, Scanner::Location class_name_location,
- bool name_is_strict_reserved, int pos, bool* ok) {
+ ExpressionClassifier* classifier, PreParserIdentifier name,
+ Scanner::Location class_name_location, bool name_is_strict_reserved,
+ int pos, bool* ok) {
// All parts of a ClassDeclaration and ClassExpression are strict code.
if (name_is_strict_reserved) {
ReportMessageAt(class_name_location,
@@ -1088,9 +1088,13 @@ PreParserExpression PreParser::ParseClassLiteral(
bool has_extends = Check(Token::EXTENDS);
if (has_extends) {
- ExpressionClassifier classifier(this);
- ParseLeftHandSideExpression(&classifier, CHECK_OK);
- ValidateExpression(&classifier, CHECK_OK);
+ ExpressionClassifier extends_classifier(this);
+ ParseLeftHandSideExpression(&extends_classifier, CHECK_OK);
+ ValidateExpression(&extends_classifier, CHECK_OK);
+ if (classifier != nullptr) {
+ classifier->Accumulate(&extends_classifier,
+ ExpressionClassifier::ExpressionProductions);
+ }
}
ClassLiteralChecker checker(this);
@@ -1104,11 +1108,15 @@ PreParserExpression PreParser::ParseClassLiteral(
bool is_computed_name = false; // Classes do not care about computed
// property names here.
Identifier name;
- ExpressionClassifier classifier(this);
+ ExpressionClassifier property_classifier(this);
ParsePropertyDefinition(&checker, in_class, has_extends, is_static,
&is_computed_name, &has_seen_constructor,
- &classifier, &name, CHECK_OK);
- ValidateExpression(&classifier, CHECK_OK);
+ &property_classifier, &name, CHECK_OK);
+ ValidateExpression(&property_classifier, CHECK_OK);
+ if (classifier != nullptr) {
+ classifier->Accumulate(&property_classifier,
+ ExpressionClassifier::ExpressionProductions);
+ }
}
Expect(Token::RBRACE, CHECK_OK);