[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
xan at webkit.org
xan at webkit.org
Wed Dec 22 13:13:45 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 0d9d2cdfb115dda8d42f0af7c735ac96865b00b5
Author: xan at webkit.org <xan at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Sep 9 06:43:22 2010 +0000
2010-09-08 Xan Lopez <xlopez at igalia.com>
Reviewed by Alexey Proskuryakov.
Remove accessor for private member variable in JSParser
https://bugs.webkit.org/show_bug.cgi?id=45378
m_token is private to JSParser, so it does not seem to be useful
to have an accessor for it. On top of that, the file was both
using the accessor and directly accessing the member variable,
only one style should be used.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 75c08ed..9239f97 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-09-08 Xan Lopez <xlopez at igalia.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Remove accessor for private member variable in JSParser
+ https://bugs.webkit.org/show_bug.cgi?id=45378
+
+ m_token is private to JSParser, so it does not seem to be useful
+ to have an accessor for it. On top of that, the file was both
+ using the accessor and directly accessing the member variable,
+ only one style should be used.
+
2010-09-08 Csaba Osztrogonác <ossy at webkit.org>
Reviewed by Oliver Hunt.
diff --git a/JavaScriptCore/parser/JSParser.cpp b/JavaScriptCore/parser/JSParser.cpp
index 6852de1..820811e 100644
--- a/JavaScriptCore/parser/JSParser.cpp
+++ b/JavaScriptCore/parser/JSParser.cpp
@@ -85,11 +85,10 @@ private:
bool m_oldAllowsIn;
};
- const JSToken& token() { return m_token; }
void next(Lexer::LexType lexType = Lexer::IdentifyReservedWords)
{
- m_lastLine = token().m_info.line;
- m_lastTokenEnd = token().m_info.endOffset;
+ m_lastLine = m_token.m_info.line;
+ m_lastTokenEnd = m_token.m_info.endOffset;
m_lexer->setLastLineNumber(m_lastLine);
m_token.m_type = m_lexer->lex(&m_token.m_data, &m_token.m_info, lexType);
m_tokenCount++;
@@ -110,17 +109,17 @@ private:
int tokenStart()
{
- return token().m_info.startOffset;
+ return m_token.m_info.startOffset;
}
int tokenLine()
{
- return token().m_info.line;
+ return m_token.m_info.line;
}
int tokenEnd()
{
- return token().m_info.endOffset;
+ return m_token.m_info.endOffset;
}
template <class TreeBuilder> TreeSourceElements parseSourceElements(TreeBuilder&);
@@ -168,7 +167,7 @@ private:
bool autoSemiColon()
{
- if (token().m_type == SEMICOLON) {
+ if (m_token.m_type == SEMICOLON) {
next();
return true;
}
@@ -324,7 +323,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseVarDeclarationList(Tr
int varStart = tokenStart();
identStart = varStart;
- const Identifier* name = token().m_data.ident;
+ const Identifier* name = m_token.m_data.ident;
lastIdent = name;
next();
bool hasInitializer = match(EQUAL);
@@ -356,7 +355,7 @@ template <class TreeBuilder> TreeConstDeclList JSParser::parseConstDeclarationLi
do {
next();
matchOrFail(IDENT);
- const Identifier* name = token().m_data.ident;
+ const Identifier* name = m_token.m_data.ident;
next();
bool hasInitializer = match(EQUAL);
context.addVar(name, DeclarationStacks::IsConstant | (hasInitializer ? DeclarationStacks::HasInitializer : 0));
@@ -482,7 +481,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseBreakStatement(TreeBui
if (autoSemiColon())
return context.createBreakStatement(startCol, endCol, startLine, endLine);
matchOrFail(IDENT);
- const Identifier* ident = token().m_data.ident;
+ const Identifier* ident = m_token.m_data.ident;
endCol = tokenEnd();
endLine = tokenLine();
next();
@@ -502,7 +501,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseContinueStatement(Tree
if (autoSemiColon())
return context.createContinueStatement(startCol, endCol, startLine, endLine);
matchOrFail(IDENT);
- const Identifier* ident = token().m_data.ident;
+ const Identifier* ident = m_token.m_data.ident;
endCol = tokenEnd();
endLine = tokenLine();
next();
@@ -654,7 +653,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseTryStatement(TreeBuild
next();
consumeOrFail(OPENPAREN);
matchOrFail(IDENT);
- ident = token().m_data.ident;
+ ident = m_token.m_data.ident;
next();
consumeOrFail(CLOSEPAREN);
matchOrFail(OPENBRACE);
@@ -705,7 +704,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseBlockStatement(TreeBui
template <class TreeBuilder> TreeStatement JSParser::parseStatement(TreeBuilder& context)
{
failIfStackOverflow();
- switch (token().m_type) {
+ switch (m_token.m_type) {
case OPENBRACE:
return parseBlockStatement(context);
case VAR:
@@ -757,14 +756,14 @@ template <class TreeBuilder> TreeStatement JSParser::parseStatement(TreeBuilder&
template <class TreeBuilder> TreeFormalParameterList JSParser::parseFormalParameters(TreeBuilder& context, bool& usesArguments)
{
matchOrFail(IDENT);
- usesArguments = m_globalData->propertyNames->arguments == *token().m_data.ident;
- TreeFormalParameterList list = context.createFormalParameterList(*token().m_data.ident);
+ usesArguments = m_globalData->propertyNames->arguments == *m_token.m_data.ident;
+ TreeFormalParameterList list = context.createFormalParameterList(*m_token.m_data.ident);
TreeFormalParameterList tail = list;
next();
while (match(COMMA)) {
next();
matchOrFail(IDENT);
- const Identifier* ident = token().m_data.ident;
+ const Identifier* ident = m_token.m_data.ident;
next();
usesArguments = usesArguments || m_globalData->propertyNames->arguments == *ident;
tail = context.createFormalParameterList(tail, *ident);
@@ -784,7 +783,7 @@ template <class TreeBuilder> TreeFunctionBody JSParser::parseFunctionBody(TreeBu
template <JSParser::FunctionRequirements requirements, class TreeBuilder> bool JSParser::parseFunctionInfo(TreeBuilder& context, const Identifier*& name, TreeFormalParameterList& parameters, TreeFunctionBody& body, int& openBracePos, int& closeBracePos, int& bodyStartLine)
{
if (match(IDENT)) {
- name = token().m_data.ident;
+ name = m_token.m_data.ident;
next();
} else if (requirements == FunctionNeedsName)
return false;
@@ -797,7 +796,7 @@ template <JSParser::FunctionRequirements requirements, class TreeBuilder> bool J
consumeOrFail(CLOSEPAREN);
matchOrFail(OPENBRACE);
- openBracePos = token().m_data.intValue;
+ openBracePos = m_token.m_data.intValue;
bodyStartLine = tokenLine();
next();
@@ -807,7 +806,7 @@ template <JSParser::FunctionRequirements requirements, class TreeBuilder> bool J
context.setUsesArguments(body);
matchOrFail(CLOSEBRACE);
- closeBracePos = token().m_data.intValue;
+ closeBracePos = m_token.m_data.intValue;
next();
return true;
}
@@ -837,7 +836,7 @@ template <class TreeBuilder> TreeStatement JSParser::parseExpressionOrLabelState
*/
int start = tokenStart();
int startLine = tokenLine();
- const Identifier* ident = token().m_data.ident;
+ const Identifier* ident = m_token.m_data.ident;
int currentToken = m_tokenCount;
TreeExpression expression = parseExpression(context);
failIfFalse(expression);
@@ -972,7 +971,7 @@ template <typename TreeBuilder> TreeExpression JSParser::parseAssignmentExpressi
Operator op;
bool hadAssignment = false;
while (true) {
- switch (token().m_type) {
+ switch (m_token.m_type) {
case EQUAL: op = OpEqual; break;
case PLUSEQUAL: op = OpPlusEq; break;
case MINUSEQUAL: op = OpMinusEq; break;
@@ -1051,11 +1050,11 @@ template <class TreeBuilder> TreeExpression JSParser::parseBinaryExpression(Tree
failIfFalse(current);
context.appendBinaryExpressionInfo(operandStackDepth, current, exprStart, lastTokenEnd(), lastTokenEnd(), initialAssignments != m_assignmentCount);
- int precedence = isBinaryOperator(token().m_type);
+ int precedence = isBinaryOperator(m_token.m_type);
if (!precedence)
break;
m_nonLHSCount++;
- int operatorToken = token().m_type;
+ int operatorToken = m_token.m_type;
next();
while (operatorStackDepth && context.operatorStackHasHigherPrecedence(operatorStackDepth, precedence)) {
@@ -1086,12 +1085,12 @@ template <class TreeBuilder> TreeExpression JSParser::parseBinaryExpression(Tree
template <bool complete, class TreeBuilder> TreeProperty JSParser::parseProperty(TreeBuilder& context)
{
bool wasIdent = false;
- switch (token().m_type) {
+ switch (m_token.m_type) {
namedProperty:
case IDENT:
wasIdent = true;
case STRING: {
- const Identifier* ident = token().m_data.ident;
+ const Identifier* ident = m_token.m_data.ident;
next(Lexer::IgnoreReservedWords);
if (match(COLON)) {
next();
@@ -1118,7 +1117,7 @@ template <bool complete, class TreeBuilder> TreeProperty JSParser::parseProperty
return context.template createGetterOrSetterProperty<complete>(type, accessorName, parameters, body, openBracePos, closeBracePos, bodyStartLine, m_lastLine);
}
case NUMBER: {
- double propertyName = token().m_data.doubleValue;
+ double propertyName = m_token.m_data.doubleValue;
next();
consumeOrFail(COLON);
TreeExpression node = parseAssignmentExpression(context);
@@ -1126,14 +1125,14 @@ template <bool complete, class TreeBuilder> TreeProperty JSParser::parseProperty
return context.template createProperty<complete>(m_globalData, propertyName, node, PropertyNode::Constant);
}
default:
- failIfFalse(token().m_type & KeywordTokenFlag);
+ failIfFalse(m_token.m_type & KeywordTokenFlag);
goto namedProperty;
}
}
template <class TreeBuilder> TreeExpression JSParser::parseObjectLiteral(TreeBuilder& context)
{
- int startOffset = token().m_data.intValue;
+ int startOffset = m_token.m_data.intValue;
consumeOrFail(OPENBRACE);
if (match(CLOSEBRACE)) {
@@ -1260,7 +1259,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseArrayLiteral(TreeBuil
template <class TreeBuilder> TreeExpression JSParser::parsePrimaryExpression(TreeBuilder& context)
{
- switch (token().m_type) {
+ switch (m_token.m_type) {
case OPENBRACE:
return parseObjectLiteral(context);
case OPENBRACKET:
@@ -1280,17 +1279,17 @@ template <class TreeBuilder> TreeExpression JSParser::parsePrimaryExpression(Tre
}
case IDENT: {
int start = tokenStart();
- const Identifier* ident = token().m_data.ident;
+ const Identifier* ident = m_token.m_data.ident;
next();
return context.createResolve(ident, start);
}
case STRING: {
- const Identifier* ident = token().m_data.ident;
+ const Identifier* ident = m_token.m_data.ident;
next();
return context.createString(ident);
}
case NUMBER: {
- double d = token().m_data.doubleValue;
+ double d = m_token.m_data.doubleValue;
next();
return context.createNumberExpr(d);
}
@@ -1372,7 +1371,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseMemberExpression(Tree
failIfFalse(base);
while (true) {
- switch (token().m_type) {
+ switch (m_token.m_type) {
case OPENBRACKET: {
int expressionEnd = lastTokenEnd();
next();
@@ -1410,7 +1409,7 @@ template <class TreeBuilder> TreeExpression JSParser::parseMemberExpression(Tree
int expressionEnd = lastTokenEnd();
next(Lexer::IgnoreReservedWords);
matchOrFail(IDENT);
- base = context.createDotAccess(base, *token().m_data.ident, expressionStart, expressionEnd, tokenEnd());
+ base = context.createDotAccess(base, *m_token.m_data.ident, expressionStart, expressionEnd, tokenEnd());
next();
break;
}
@@ -1428,15 +1427,15 @@ template <class TreeBuilder> TreeExpression JSParser::parseUnaryExpression(TreeB
{
AllowInOverride allowInOverride(this);
int tokenStackDepth = 0;
- while (isUnaryOp(token().m_type)) {
+ while (isUnaryOp(m_token.m_type)) {
m_nonLHSCount++;
- context.appendUnaryToken(tokenStackDepth, token().m_type, tokenStart());
+ context.appendUnaryToken(tokenStackDepth, m_token.m_type, tokenStart());
next();
}
int subExprStart = tokenStart();
TreeExpression expr = parseMemberExpression(context);
failIfFalse(expr);
- switch (token().m_type) {
+ switch (m_token.m_type) {
case PLUSPLUS:
m_nonLHSCount++;
expr = context.makePostfixNode(expr, OpPlusPlus, subExprStart, lastTokenEnd(), tokenEnd());
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list