| 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 x / y returns ToNumber(x) / ToNumber(y) |
| 6 |
es5id: 11.5.2_A3_T2.8 |
| 7 |
description: > |
| 8 |
Type(x) is different from Type(y) and both types vary between |
| 9 |
Boolean (primitive or object) and Undefined |
| 10 |
---*/ |
| 11 |
|
| 12 |
//CHECK#1 |
| 13 |
if (isNaN(true / undefined) !== true) { |
| 14 |
$ERROR('#1: true / undefined === Not-a-Number. Actual: ' + (true / undefined)); |
| 15 |
} |
| 16 |
|
| 17 |
//CHECK#2 |
| 18 |
if (isNaN(undefined / true) !== true) { |
| 19 |
$ERROR('#2: undefined / true === Not-a-Number. Actual: ' + (undefined / true)); |
| 20 |
} |
| 21 |
|
| 22 |
//CHECK#3 |
| 23 |
if (isNaN(new Boolean(true) / undefined) !== true) { |
| 24 |
$ERROR('#3: new Boolean(true) / undefined === Not-a-Number. Actual: ' + (new Boolean(true) / undefined)); |
| 25 |
} |
| 26 |
|
| 27 |
//CHECK#4 |
| 28 |
if (isNaN(undefined / new Boolean(true)) !== true) { |
| 29 |
$ERROR('#4: undefined / new Boolean(true) === Not-a-Number. Actual: ' + (undefined / new Boolean(true))); |
| 30 |
} |