~ubuntu-branches/ubuntu/vivid/mozjs24/vivid

« back to all changes in this revision

Viewing changes to js/src/tests/test262/ch11/11.13/11.13.2/S11.13.2_A4.9_T2.9.js

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2014-02-11 21:55:34 UTC
  • Revision ID: package-import@ubuntu.com-20140211215534-m1zyq5aj59md3y07
Tags: upstream-24.2.0
ImportĀ upstreamĀ versionĀ 24.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 * The production x &= y is the same as x = x & y
 
6
 *
 
7
 * @path ch11/11.13/11.13.2/S11.13.2_A4.9_T2.9.js
 
8
 * @description Type(x) is different from Type(y) and both types vary between Boolean (primitive or object) and Null
 
9
 */
 
10
 
 
11
//CHECK#1
 
12
x = true;
 
13
x &= null;
 
14
if (x !== 0) {
 
15
  $ERROR('#1: x = true; x &= null; x === 0. Actual: ' + (x));
 
16
}
 
17
 
 
18
//CHECK#2
 
19
x = null;
 
20
x &= true;
 
21
if (x !== 0) {
 
22
  $ERROR('#2: x = null; x &= true; x === 0. Actual: ' + (x));
 
23
}
 
24
 
 
25
//CHECK#3
 
26
x = new Boolean(true);
 
27
x &= null;
 
28
if (x !== 0) {
 
29
  $ERROR('#3: x = new Boolean(true); x &= null; x === 0. Actual: ' + (x));
 
30
}
 
31
 
 
32
//CHECK#4
 
33
x = null;
 
34
x &= new Boolean(true);
 
35
if (x !== 0) {
 
36
  $ERROR('#4: x = null; x &= new Boolean(true); x === 0. Actual: ' + (x));
 
37
}
 
38