Merge branch 'master' into harmony

This commit is contained in:
Richard van Velzen
2016-08-15 09:09:04 +02:00
27 changed files with 717 additions and 51 deletions

View File

@@ -402,6 +402,9 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
return RE_NUM_LITERAL.test(ch);
});
if (prefix) num = prefix + num;
if (RE_OCT_NUMBER.test(num) && next_token.has_directive("use strict")) {
parse_error("SyntaxError: Legacy octal literals are not allowed in strict mode");
}
var valid = parse_js_number(num);
if (!isNaN(valid)) {
return token("num", valid);
@@ -460,7 +463,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
// Parse
if (ch === "0") return "\0";
if (ch.length > 0 && next_token.has_directive("use strict"))
parse_error("SyntaxError: Octal literals are not allowed in strict mode");
parse_error("SyntaxError: Legacy octal escape sequences are not allowed in strict mode");
return String.fromCharCode(parseInt(ch, 8));
}
@@ -619,7 +622,7 @@ function tokenizer($TEXT, filename, html5_comments, shebang) {
try {
return token("regexp", new RegExp(regexp, mods));
} catch(e) {
parse_error(e.message);
parse_error("SyntaxError: " + e.message);
}
});