| 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 production x -= y is the same as x = x - y |
| 6 |
es5id: 11.13.2_A4.5_T1.4 |
| 7 |
description: Type(x) and Type(y) vary between Null and Undefined |
| 8 |
---*/ |
| 9 |
|
| 10 |
var x; |
| 11 |
|
| 12 |
//CHECK#1 |
| 13 |
x = null; |
| 14 |
x -= undefined; |
| 15 |
if (isNaN(x) !== true) { |
| 16 |
$ERROR('#1: x = null; x -= undefined; x === Not-a-Number. Actual: ' + (x)); |
| 17 |
} |
| 18 |
|
| 19 |
//CHECK#2 |
| 20 |
x = undefined; |
| 21 |
x -= null; |
| 22 |
if (isNaN(x) !== true) { |
| 23 |
$ERROR('#2: x = undefined; x -= null; x === Not-a-Number. Actual: ' + (x)); |
| 24 |
} |
| 25 |
|
| 26 |
//CHECK#3 |
| 27 |
x = undefined; |
| 28 |
x -= undefined; |
| 29 |
if (isNaN(x) !== true) { |
| 30 |
$ERROR('#3: x = undefined; x -= undefined; x === Not-a-Number. Actual: ' + (x)); |
| 31 |
} |
| 32 |
|
| 33 |
//CHECK#4 |
| 34 |
x = null; |
| 35 |
x -= null; |
| 36 |
if (x !== 0) { |
| 37 |
$ERROR('#4: x = null; x -= null; x === 0. Actual: ' + (x)); |
| 38 |
} |