blob: 543ef2cb46798b6e5ad9a0e63966e703ea5c3b91 [file] [log] [blame]
keith_miller@apple.combcc77f22016-07-15 06:03:25 +00001// Copyright 2009 the Sputnik authors. All rights reserved.
2// This code is governed by the BSD license found in the LICENSE file.
3
4/*---
5info: The production x ^= y is the same as x = x ^ y
6es5id: 11.13.2_A4.10_T1.3
7description: Type(x) and Type(y) vary between primitive string and String object
8---*/
9
10var x;
11
12//CHECK#1
13x = "1";
14x ^= "1";
15if (x !== 0) {
16 $ERROR('#1: x = "1"; x ^= "1"; x === 0. Actual: ' + (x));
17}
18
19//CHECK#2
20x = new String("1");
21x ^= "1";
22if (x !== 0) {
23 $ERROR('#2: x = new String("1"); x ^= "1"; x === 0. Actual: ' + (x));
24}
25
26//CHECK#3
27x = "1";
28x ^= new String("1");
29if (x !== 0) {
30 $ERROR('#3: x = "1"; x ^= new String("1"); x === 0. Actual: ' + (x));
31}
32
33//CHECK#4
34x = new String("1");
35x ^= new String("1");
36if (x !== 0) {
37 $ERROR('#4: x = new String("1"); x ^= new String("1"); x === 0. Actual: ' + (x));
38}
39
40//CHECK#5
41x = "x";
42x ^= "1";
43if (x !== 1) {
44 $ERROR('#5: x = "x"; x ^= "1"; x === 1. Actual: ' + (x));
45}
46
47//CHECK#6
48x = "1";
49x ^= "x";
50if (x !== 1) {
51 $ERROR('#6: x = "1"; x ^= "x"; x === 1. Actual: ' + (x));
52}