From cd44dc59cdfc39534aef4d417e9f3c412e3be139 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 3 Feb 2012 09:55:33 +0100 Subject: Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560) --- Source/JavaScriptCore/parser/Parser.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'Source/JavaScriptCore/parser/Parser.cpp') diff --git a/Source/JavaScriptCore/parser/Parser.cpp b/Source/JavaScriptCore/parser/Parser.cpp index 5c2f0383f..ce6519873 100644 --- a/Source/JavaScriptCore/parser/Parser.cpp +++ b/Source/JavaScriptCore/parser/Parser.cpp @@ -43,7 +43,7 @@ template Parser::Parser(JSGlobalData* globalData, const SourceCode& source, FunctionParameters* parameters, JSParserStrictness strictness, JSParserMode parserMode) : m_globalData(globalData) , m_source(&source) - , m_stack(globalData->stack()) + , m_stack(wtfThreadData().stack()) , m_error(false) , m_errorMessage("Parse error") , m_allowsIn(true) @@ -603,7 +603,6 @@ template TreeStatement Parser::parseTryStatement( ASSERT(match(TRY)); TreeStatement tryBlock = 0; const Identifier* ident = &m_globalData->propertyNames->nullIdentifier; - bool catchHasEval = false; TreeStatement catchBlock = 0; TreeStatement finallyBlock = 0; int firstLine = tokenLine(); @@ -626,10 +625,8 @@ template TreeStatement Parser::parseTryStatement( catchScope->preventNewDecls(); consumeOrFail(CLOSEPAREN); matchOrFail(OPENBRACE); - int initialEvalCount = context.evalCount(); catchBlock = parseBlockStatement(context); failIfFalseWithMessage(catchBlock, "'try' must have a catch or finally block"); - catchHasEval = initialEvalCount != context.evalCount(); failIfFalse(popScope(catchScope, TreeBuilder::NeedsFreeVariableInfo)); } @@ -640,7 +637,7 @@ template TreeStatement Parser::parseTryStatement( failIfFalse(finallyBlock); } failIfFalse(catchBlock || finallyBlock); - return context.createTryStatement(m_lexer->lastLineNumber(), tryBlock, ident, catchHasEval, catchBlock, finallyBlock, firstLine, lastLine); + return context.createTryStatement(m_lexer->lastLineNumber(), tryBlock, ident, catchBlock, finallyBlock, firstLine, lastLine); } template @@ -1512,23 +1509,20 @@ template TreeExpression Parser::parseMemberExpres } case OPENPAREN: { m_nonTrivialExpressionCount++; + int nonLHSCount = m_nonLHSCount; if (newCount) { newCount--; - if (match(OPENPAREN)) { - int exprEnd = lastTokenEnd(); - TreeArguments arguments = parseArguments(context); - failIfFalse(arguments); - base = context.createNewExpr(m_lexer->lastLineNumber(), base, arguments, start, exprEnd, lastTokenEnd()); - } else - base = context.createNewExpr(m_lexer->lastLineNumber(), base, start, lastTokenEnd()); + int exprEnd = lastTokenEnd(); + TreeArguments arguments = parseArguments(context); + failIfFalse(arguments); + base = context.createNewExpr(m_lexer->lastLineNumber(), base, arguments, start, exprEnd, lastTokenEnd()); } else { - int nonLHSCount = m_nonLHSCount; int expressionEnd = lastTokenEnd(); TreeArguments arguments = parseArguments(context); failIfFalse(arguments); base = context.makeFunctionCallNode(m_lexer->lastLineNumber(), base, arguments, expressionStart, expressionEnd, lastTokenEnd()); - m_nonLHSCount = nonLHSCount; } + m_nonLHSCount = nonLHSCount; break; } case DOT: { -- cgit v1.2.3