Index: test/mjsunit/harmony/templates.js |
diff --git a/test/mjsunit/harmony/templates.js b/test/mjsunit/harmony/templates.js |
index e2e89dc67f4cf2e74d411bf8f40ffbf021a6bfdc..c339bb8cc7609f0eff03f84b85c790d036559ef1 100644 |
--- a/test/mjsunit/harmony/templates.js |
+++ b/test/mjsunit/harmony/templates.js |
@@ -476,9 +476,11 @@ var obj = { |
(function testLegacyOctal() { |
assertEquals('\u0000', `\0`); |
assertEquals('\u0000a', `\0a`); |
- for (var i = 0; i < 10; i++) { |
+ for (var i = 0; i < 8; i++) { |
var code = "`\\0" + i + "`"; |
assertThrows(code, SyntaxError); |
+ code = "(function(){})" + code; |
+ assertThrows(code, SyntaxError); |
} |
assertEquals('\\0', String.raw`\0`); |
@@ -488,8 +490,18 @@ var obj = { |
(function testSyntaxErrorsNonEscapeCharacter() { |
assertThrows("`\\x`", SyntaxError); |
assertThrows("`\\u`", SyntaxError); |
- for (var i = 1; i < 10; i++) { |
+ for (var i = 1; i < 8; i++) { |
var code = "`\\" + i + "`"; |
assertThrows(code, SyntaxError); |
+ code = "(function(){})" + code; |
+ assertThrows(code, SyntaxError); |
} |
})(); |
+ |
+ |
+(function testValidNumericEscapes() { |
+ assertEquals("8", `\8`); |
+ assertEquals("9", `\9`); |
+ assertEquals("\u00008", `\08`); |
+ assertEquals("\u00009", `\09`); |
+})(); |