Final polishing after rebase.

This commit is contained in:
Ingvar Stepanyan 2014-09-05 17:23:03 +03:00
parent 2fbf640e60
commit 5c89414c5a

View File

@ -883,7 +883,7 @@
var content = "", escaped, inClass, start = tokPos;
for (;;) {
if (tokPos >= inputLen) raise(start, "Unterminated regular expression");
var ch = input.charAt(tokPos);
var ch = nextChar();
if (newline.test(ch)) raise(start, "Unterminated regular expression");
if (!escaped) {
if (ch === "[") inClass = true;
@ -1332,7 +1332,8 @@
if (ch !== '&') raise(tokPos, "Entity must start with an ampersand");
tokPos++;
while (tokPos < inputLen && count++ < 10) {
ch = input.charAt(tokPos++);
ch = nextChar();
tokPos++;
if (ch === ';') {
break;
}
@ -1421,7 +1422,7 @@
for (;;) {
var ch = input.charCodeAt(tokPos);
if (isIdentifierChar(ch) || (inXJSTag && ch === 45)) {
if (containsEsc) word += input.charAt(tokPos);
if (containsEsc) word += nextChar();
++tokPos;
} else if (ch === 92 && !inXJSTag) { // "\"
if (!containsEsc) word = input.slice(start, tokPos);
@ -1597,14 +1598,6 @@
eat(type) || unexpected();
}
// Expect a char. If found, consume it, otherwise,
// raise an unexpected token error.
function expectChar(ch) {
if (tokVal === ch) next();
else unexpected();
}
// Get following char.
function nextChar() {