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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/preparser.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --harmony-templates --harmony-unicode 5 // Flags: --harmony-templates --harmony-unicode
6 6
7 var num = 5; 7 var num = 5;
8 var str = "str"; 8 var str = "str";
9 function fn() { return "result"; } 9 function fn() { return "result"; }
10 var obj = { 10 var obj = {
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } 498 }
499 })(); 499 })();
500 500
501 501
502 (function testValidNumericEscapes() { 502 (function testValidNumericEscapes() {
503 assertEquals("8", `\8`); 503 assertEquals("8", `\8`);
504 assertEquals("9", `\9`); 504 assertEquals("9", `\9`);
505 assertEquals("\u00008", `\08`); 505 assertEquals("\u00008", `\08`);
506 assertEquals("\u00009", `\09`); 506 assertEquals("\u00009", `\09`);
507 })(); 507 })();
508
509
510 (function testLegacyOctalEscapesInExpressions() {
511 // Allowed in sloppy expression
512 assertEquals("\x07", `${"\07"}`);
513
514 // Disallowed in template tail
515 assertThrows("`${\"\\07\"}\\07`", SyntaxError);
516
517 // Disallowed in strict expression
518 assertThrows("`${(function() { \"use strict\"; return \"\\07\"; })()}`",
519 SyntaxError);
520 })();
OLDNEW
« 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