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

Side by Side Diff: LayoutTests/fast/js/script-tests/numeric-escapes-in-string-literals.js

Issue 20867002: Remove old tests that have been migrated to the v8 repo. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove unused script-tests as well Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 description(
2 "Test numeric escapes in string literals - https://bugs.webkit.org/show_bug.cgi? id=51724"
3 );
4
5 function test(_stringLiteral, _nonStrictResult, _strictResult)
6 {
7 stringLiteral = '"' + _stringLiteral + '"';
8 nonStrictResult = _nonStrictResult;
9 shouldBe("eval(stringLiteral)", "nonStrictResult");
10
11 stringLiteral = '"use strict"; ' + stringLiteral;
12 if (_strictResult) {
13 strictResult = _strictResult;
14 shouldBe("eval(stringLiteral)", "strictResult");
15 } else
16 shouldThrow("eval(stringLiteral)");
17 }
18
19 // Tests for single digit octal and decimal escapes.
20 // In non-strict mode 0-7 are octal escapes, 8-9 are NonEscapeCharacters.
21 // In strict mode only "\0" is permitted.
22 test("\\0", "\x00", "\x00");
23 test("\\1", "\x01");
24 test("\\7", "\x07");
25 test("\\8", "8");
26 test("\\9", "9");
27
28 // Tests for multi-digit octal values outside strict mode;
29 // Octal literals may be 1-3 digits long. In strict more all multi-digit sequen ces are illegal.
30 test("\\00", "\x00");
31 test("\\000", "\x00");
32 test("\\0000", "\x000");
33
34 test("\\01", "\x01");
35 test("\\001", "\x01");
36 test("\\0001", "\x001");
37
38 test("\\10", "\x08");
39 test("\\100", "\x40");
40 test("\\1000", "\x400");
41
42 test("\\19", "\x019");
43 test("\\109", "\x089");
44 test("\\1009", "\x409");
45
46 test("\\99", "99");
OLDNEW
« no previous file with comments | « LayoutTests/fast/js/script-tests/number-toprecision.js ('k') | LayoutTests/fast/js/script-tests/object-bad-time.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698