diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
commit | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch) | |
tree | 52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/JavaScriptCore/parser/Parser.cpp | |
parent | cd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff) | |
download | qtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz |
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/JavaScriptCore/parser/Parser.cpp')
-rw-r--r-- | Source/JavaScriptCore/parser/Parser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/parser/Parser.cpp b/Source/JavaScriptCore/parser/Parser.cpp index ce6519873..25ada5606 100644 --- a/Source/JavaScriptCore/parser/Parser.cpp +++ b/Source/JavaScriptCore/parser/Parser.cpp @@ -1240,6 +1240,8 @@ template <typename LexerType> template <class TreeBuilder> TreeExpression Parser<LexerType>::parseObjectLiteral(TreeBuilder& context) { int startOffset = m_token.m_data.intValue; + unsigned oldLastLineNumber = m_lexer->lastLineNumber(); + unsigned oldLineNumber = m_lexer->lineNumber(); consumeOrFailWithFlags(OPENBRACE, TreeBuilder::DontBuildStrings); if (match(CLOSEBRACE)) { @@ -1252,6 +1254,8 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseObjectLitera if (!m_syntaxAlreadyValidated && context.getType(property) != PropertyNode::Constant) { m_lexer->setOffset(startOffset); next(); + m_lexer->setLastLineNumber(oldLastLineNumber); + m_lexer->setLineNumber(oldLineNumber); return parseStrictObjectLiteral(context); } TreePropertyList propertyList = context.createPropertyList(m_lexer->lastLineNumber(), property); @@ -1266,6 +1270,8 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseObjectLitera if (!m_syntaxAlreadyValidated && context.getType(property) != PropertyNode::Constant) { m_lexer->setOffset(startOffset); next(); + m_lexer->setLastLineNumber(oldLastLineNumber); + m_lexer->setLineNumber(oldLineNumber); return parseStrictObjectLiteral(context); } tail = context.createPropertyList(m_lexer->lastLineNumber(), property, tail); |