summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/parser/Lexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/parser/Lexer.cpp')
-rw-r--r--JavaScriptCore/parser/Lexer.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/JavaScriptCore/parser/Lexer.cpp b/JavaScriptCore/parser/Lexer.cpp
index cc4321d..b443561 100644
--- a/JavaScriptCore/parser/Lexer.cpp
+++ b/JavaScriptCore/parser/Lexer.cpp
@@ -453,7 +453,7 @@ ALWAYS_INLINE JSTokenType Lexer::parseIdentifier(JSTokenData* lvalp, LexType lex
return IDENT;
}
-ALWAYS_INLINE bool Lexer::parseString(JSTokenData* lvalp)
+ALWAYS_INLINE bool Lexer::parseString(JSTokenData* lvalp, bool strictMode)
{
int stringQuoteCharacter = m_current;
shift();
@@ -494,6 +494,8 @@ ALWAYS_INLINE bool Lexer::parseString(JSTokenData* lvalp)
return false;
} else if (isASCIIOctalDigit(m_current)) {
// Octal character sequences
+ if (strictMode)
+ return false;
int character1 = m_current;
shift();
if (isASCIIOctalDigit(m_current)) {
@@ -696,7 +698,7 @@ ALWAYS_INLINE bool Lexer::parseMultilineComment()
}
}
-JSTokenType Lexer::lex(JSTokenData* lvalp, JSTokenInfo* llocp, LexType lexType)
+JSTokenType Lexer::lex(JSTokenData* lvalp, JSTokenInfo* llocp, LexType lexType, bool strictMode)
{
ASSERT(!m_error);
ASSERT(m_buffer8.isEmpty());
@@ -976,8 +978,11 @@ start:
} else {
record8('0');
if (isASCIIOctalDigit(m_current)) {
- if (parseOctal(lvalp->doubleValue))
+ if (parseOctal(lvalp->doubleValue)) {
+ if (strictMode)
+ goto returnError;
token = NUMBER;
+ }
}
}
// Fall through into CharacterNumber
@@ -1006,7 +1011,7 @@ inNumberAfterDecimalPoint:
m_delimited = false;
break;
case CharacterQuote:
- if (UNLIKELY(!parseString(lvalp)))
+ if (UNLIKELY(!parseString(lvalp, strictMode)))
goto returnError;
shift();
m_delimited = false;
@@ -1023,11 +1028,6 @@ inNumberAfterDecimalPoint:
shiftLineTerminator();
m_atLineStart = true;
m_terminator = true;
- if (lastTokenWasRestrKeyword()) {
- token = SEMICOLON;
- m_delimited = true;
- goto returnToken;
- }
goto start;
case CharacterInvalid:
goto returnError;