|
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 * Operator x-- uses GetValue and PutValue |
|
6 * |
|
7 * @path ch11/11.3/11.3.2/S11.3.2_A2.1_T1.js |
|
8 * @description Type(x) is Reference and GetBase(x) is not null |
|
9 */ |
|
10 |
|
11 //CHECK#1 |
|
12 var x = 1; |
|
13 if (x-- !== 1) { |
|
14 $ERROR('#1: var x = 1; x-- === 1. Actual: ' + (x--)); |
|
15 } else { |
|
16 if (x !== 1 - 1) { |
|
17 $ERROR('#1: var x = 1; x--; x === 1 - 1. Actual: ' + (x)); |
|
18 } |
|
19 } |
|
20 |
|
21 //CHECK#2 |
|
22 this.x = 1; |
|
23 if (this.x-- !== 1) { |
|
24 $ERROR('#2: this.x = 1; this.x-- === 1. Actual: ' + (this.x--)); |
|
25 } else { |
|
26 if (this.x !== 1 - 1) { |
|
27 $ERROR('#2: this.x = 1; this.x--; this.x === 1 - 1. Actual: ' + (this.x)); |
|
28 } |
|
29 } |
|
30 |
|
31 //CHECK#3 |
|
32 var object = new Object(); |
|
33 object.prop = 1; |
|
34 if (object.prop-- !== 1) { |
|
35 $ERROR('#3: var object = new Object(); object.prop = 1; object.prop-- === 1. Actual: ' + (object.prop--)); |
|
36 } else { |
|
37 if (this.x !== 1 - 1) { |
|
38 $ERROR('#3: var object = new Object(); object.prop = 1; object.prop--; object.prop === 1 - 1. Actual: ' + (object.prop)); |
|
39 } |
|
40 } |
|
41 |