Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/parseFloat/S15.1.2.3_A2_T10_U180E.js

raw
1 // Copyright (C) 2016 André Bargull. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 es6id: 18.2.4
6 esid: sec-parsefloat-string
7 description: >
8 Leading U+180E is not recognized as whitespace
9 info: |
10 18.2.4 parseFloat (string)
11
12 ...
13 3. Let trimmedString be a substring of inputString consisting of the
14 leftmost code unit that is not a StrWhiteSpaceChar and all code units
15 to the right of that code unit. (In other words, remove leading white
16 space.) If inputString does not contain any such code units, let
17 trimmedString be the empty string.
18 4. If neither trimmedString nor any prefix of trimmedString satisfies the
19 syntax of a StrDecimalLiteral (see 7.1.3.1), return NaN.
20 ...
21 features: [u180e]
22 ---*/
23
24 var mongolianVowelSeparator = "\u180E";
25
26 assert.sameValue(parseFloat(mongolianVowelSeparator + "1.1"), NaN, "Single leading U+180E");
27 assert.sameValue(parseFloat(mongolianVowelSeparator + mongolianVowelSeparator + mongolianVowelSeparator + "1.1"), NaN, "Multiple leading U+180E");
28 assert.sameValue(parseFloat(mongolianVowelSeparator), NaN, "Only U+180E");