| 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: The parseFloat property can't be used as constructor |
| 6 |
es5id: 15.1.2.3_A7.7 |
| 7 |
es6id: 18.2.4 |
| 8 |
esid: sec-parsefloat-string |
| 9 |
description: > |
| 10 |
If property does not implement the internal [[Construct]] method, |
| 11 |
throw a TypeError exception |
| 12 |
---*/ |
| 13 |
|
| 14 |
//CHECK#1 |
| 15 |
|
| 16 |
try { |
| 17 |
new parseFloat(); |
| 18 |
$ERROR('#1.1: new parseFloat() throw TypeError. Actual: ' + (new parseFloat())); |
| 19 |
} catch (e) { |
| 20 |
if ((e instanceof TypeError) !== true) { |
| 21 |
$ERROR('#1.2: new parseFloat() throw TypeError. Actual: ' + (e)); |
| 22 |
} |
| 23 |
} |