corrections for octal escape sequences; allows "\0" alone; see #1547

Relevant sections of the spec:
* http://es5.github.com/#C
* http://es5.github.com/#B.1.2
* http://es5.github.com/#x7.8.4
This commit is contained in:
Michael Ficarra
2012-04-20 18:29:40 -04:00
parent eabcb2c8b0
commit 46ff7705ee
3 changed files with 23 additions and 14 deletions

View File

@@ -168,7 +168,7 @@
default:
return 0;
}
if (octalEsc = /^(?:\\.|[^\\])*\\[0-7]/.test(string)) {
if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) {
this.error("octal escape sequences " + string + " are not allowed");
}
this.line += count(string, '\n');