| 1 |
// Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
info: Operator remove leading StrWhiteSpaceChar |
| 6 |
es5id: 15.1.2.3_A2_T10 |
| 7 |
es6id: 18.2.4 |
| 8 |
esid: sec-parsefloat-string |
| 9 |
description: "StrWhiteSpaceChar :: USP" |
| 10 |
---*/ |
| 11 |
|
| 12 |
//CHECK# |
| 13 |
var n; |
| 14 |
var count = 0; |
| 15 |
var errorCount = 0; |
| 16 |
var uspU = ["\u1680", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000"]; |
| 17 |
var uspS = ["1680", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "200A", "202F", "205F", "3000"]; |
| 18 |
for (var index = 0; index < uspU.length; index++) { |
| 19 |
var result = true; |
| 20 |
n = false; |
| 21 |
if (parseFloat(uspU[index] + "1.1") !== parseFloat("1.1")) { |
| 22 |
$ERROR('#1.' + uspS[index] + ' '); |
| 23 |
result = false; |
| 24 |
} |
| 25 |
if (parseFloat(uspU[index] + uspU[index] + uspU[index] + "1.1") !== parseFloat("1.1")) { |
| 26 |
$ERROR('#2.' + uspS[index] + ' '); |
| 27 |
result = false; |
| 28 |
} |
| 29 |
n = parseFloat(uspU[index]); |
| 30 |
if (!(n !== n)) { |
| 31 |
$ERROR('#3.' + uspS[index] + ' '); |
| 32 |
result = false; |
| 33 |
} |
| 34 |
if (result !== true) { |
| 35 |
errorCount++; |
| 36 |
} |
| 37 |
count++; |
| 38 |
} |
| 39 |
|
| 40 |
if (errorCount > 0) { |
| 41 |
$ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count); |
| 42 |
} |