Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/assignment/S11.13.1_A2.1_T1.js

raw
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 uses GetValue and PutValue
6 es5id: 11.13.1_A2.1_T1
7 description: Either AssigmentExpression is not Reference or GetBase is not null
8 ---*/
9
10 //CHECK#1
11 x = 1;
12 if (x !== 1) {
13 $ERROR('#1: x = 1; x === 1. Actual: ' + (x));
14 }
15
16 //CHECK#2
17 var x = 1;
18 if (x !== 1) {
19 $ERROR('#2: var x = 1; x === 1. Actual: ' + (x));
20 }
21
22 //CHECK#3
23 y = 1;
24 x = y;
25 if (x !== 1) {
26 $ERROR('#3: y = 1; x = y; x === 1. Actual: ' + (x));
27 }
28
29 //CHECK#4
30 var y = 1;
31 var x = y;
32 if (x !== 1) {
33 $ERROR('#4: var y = 1; var x = y; x === 1. Actual: ' + (x));
34 }
35
36 //CHECK#5
37 var objectx = new Object();
38 var objecty = new Object();
39 objecty.prop = 1.1;
40 objectx.prop = objecty.prop;
41 if (objectx.prop !== objecty.prop) {
42 $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objecty.prop = 1; objectx.prop = objecty.prop; objectx.prop === objecty.prop. Actual: ' + (objectx.prop));
43 } else {
44 if (objectx === objecty) {
45 $ERROR('#5: var objectx = new Object(); var objecty = new Object(); objecty.prop = 1; objectx.prop = objecty.prop; objectx !== objecty');
46 }
47 }