diff options
author | Doug Ilijev <dilijev@users.noreply.github.com> | 2017-03-28 17:09:16 -0700 |
---|---|---|
committer | Leo Balter <leonardo.balter@gmail.com> | 2017-03-28 20:09:16 -0400 |
commit | 5da6f981e9c6eb6d8af9ad8be737fb2245cf2fdb (patch) | |
tree | 498850a9989685903149005611ff4a0656aa9225 /test/annexB | |
parent | 882b3cc0d073acb15f864504cea13fc07a0ec26e (diff) | |
download | qtdeclarative-testsuites-5da6f981e9c6eb6d8af9ad8be737fb2245cf2fdb.tar.gz |
Add escape-above-astral.js to cover escaping code units as encoded from extended unicode escape. (#942)
Diffstat (limited to 'test/annexB')
-rw-r--r-- | test/annexB/built-ins/escape/escape-above-astral.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/annexB/built-ins/escape/escape-above-astral.js b/test/annexB/built-ins/escape/escape-above-astral.js new file mode 100644 index 000000000..0cbba08d6 --- /dev/null +++ b/test/annexB/built-ins/escape/escape-above-astral.js @@ -0,0 +1,22 @@ +// Copyright (C) 2017 Microsoft Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +es6id: B.2.1.1 +description: Escaping of code units above 255 from string with extended Unicode escape sequence +info: | + [...] + 5. Repeat, while k < length, + a. Let char be the code unit (represented as a 16-bit unsigned integer) + at index k within string. + [...] + c. Else if char ≥ 256, then + i. Let S be a String containing six code units "%uwxyz" where wxyz + are the code units of the four uppercase hexadecimal digits + encoding the value of char. + [...] +---*/ + +assert.sameValue( + escape('\u{10401}'), '%uD801%uDC01', '\\u{10401} => \\uD801\\uDC01 (surrogate pairs encoded in string)' +); |