Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Unified Diff: test/mjsunit/harmony/templates.js

Issue 808793004: Check for octals in template spans only, not expressions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/preparser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/templates.js
diff --git a/test/mjsunit/harmony/templates.js b/test/mjsunit/harmony/templates.js
index c339bb8cc7609f0eff03f84b85c790d036559ef1..a884f58fb657b31d2cce4e51dd39e7ed831dd73c 100644
--- a/test/mjsunit/harmony/templates.js
+++ b/test/mjsunit/harmony/templates.js
@@ -505,3 +505,16 @@ var obj = {
assertEquals("\u00008", `\08`);
assertEquals("\u00009", `\09`);
})();
+
+
+(function testLegacyOctalEscapesInExpressions() {
+ // Allowed in sloppy expression
+ assertEquals("\x07", `${"\07"}`);
+
+ // Disallowed in template tail
+ assertThrows("`${\"\\07\"}\\07`", SyntaxError);
+
+ // Disallowed in strict expression
+ assertThrows("`${(function() { \"use strict\"; return \"\\07\"; })()}`",
+ SyntaxError);
+})();
« no previous file with comments | « src/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698