summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/parseFloat/S15.1.2.3_A2_T10_U180E.js
blob: a687528aabd426fe64e1ddd7026b0d2c60cfa9ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (C) 2016 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-parsefloat-string
description: >
  Leading U+180E is not recognized as whitespace
info: |
  18.2.4 parseFloat (string)

  ...
  3. Let trimmedString be a substring of inputString consisting of the
     leftmost code unit that is not a StrWhiteSpaceChar and all code units
     to the right of that code unit. (In other words, remove leading white
     space.) If inputString does not contain any such code units, let
     trimmedString be the empty string.
  4. If neither trimmedString nor any prefix of trimmedString satisfies the
     syntax of a StrDecimalLiteral (see 7.1.3.1), return NaN.
  ...
features: [u180e]
---*/

var mongolianVowelSeparator = "\u180E";

assert.sameValue(parseFloat(mongolianVowelSeparator + "1.1"), NaN, "Single leading U+180E");
assert.sameValue(parseFloat(mongolianVowelSeparator + mongolianVowelSeparator + mongolianVowelSeparator + "1.1"), NaN, "Multiple leading U+180E");
assert.sameValue(parseFloat(mongolianVowelSeparator), NaN, "Only U+180E");

reportCompare(0, 0);