Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / script-tests / normal-character-escapes-in-string-literals.js
blobcb384f4fafcd495201a5713a2d67faeb142061e2
1 description(
2 "Test non-escaping characters in string literals - added with https://bugs.webkit.org/show_bug.cgi?id=100580"
3 );
5 function test(character)
7 shouldBeEqualToString('eval(\'"\\' + character + '"\')', character);
10 charactersToTest = " !#$%&\'()*+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`acdeghijklmopqswyz{|}~";
12 for (i = 0; i < charactersToTest.length; i++)
13 test(charactersToTest.charAt(i));
15 function testOther(character)
17 shouldEvaluateTo('eval(\'"\\' + character + '"\').charCodeAt(0)', character.charCodeAt(0));
20 // Test some characters outside the printable ASCII range
21 otherCharactersToTest = "\x01\x07\x08\x1f\xa0\xa3\xab\xb4";
23 for (i = 0; i < otherCharactersToTest.length; i++)
24 testOther(otherCharactersToTest.charAt(i));