1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/test262/ch11/11.3/11.3.1/S11.3.1_A2.1_T1.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,46 @@ 1.4 +// Copyright 2009 the Sputnik authors. All rights reserved. 1.5 +// This code is governed by the BSD license found in the LICENSE file. 1.6 + 1.7 +/** 1.8 + * Operator x++ uses GetValue and PutValue 1.9 + * 1.10 + * @path ch11/11.3/11.3.1/S11.3.1_A2.1_T1.js 1.11 + * @description Type(x) is Reference and GetBase(x) is not null 1.12 + */ 1.13 + 1.14 +//CHECK#1 1.15 +var x = 1; 1.16 +var y = x++; 1.17 +if (y !== 1) { 1.18 + $ERROR('#1: var x = 1; var y = x++; y === 1. Actual: ' + (y)); 1.19 +} else { 1.20 + if (x !== 1 + 1) { 1.21 + $ERROR('#1: var x = 1; var y = x++; x === 1 + 1. Actual: ' + (x)); 1.22 + } 1.23 +} 1.24 + 1.25 +//CHECK#2 1.26 +this.x = 1; 1.27 +var y = this.x++; 1.28 +if (y !== 1) { 1.29 + $ERROR('#2: this.x = 1; var y = this.x++; y === 1. Actual: ' + (y)); 1.30 +} else { 1.31 + if (this.x !== 1 + 1) { 1.32 + $ERROR('#2: this.x = 1; var y = this.x++; this.x === 1 + 1. Actual: ' + (this.x)); 1.33 + } 1.34 +} 1.35 + 1.36 +//CHECK#3 1.37 +var object = new Object(); 1.38 +object.prop = 1; 1.39 +var y = object.prop++; 1.40 +if (y !== 1) { 1.41 + $ERROR('#3: var object = new Object(); object.prop = 1; var y = object.prop++; y === 1. Actual: ' + (y)); 1.42 +} else { 1.43 + if (this.x !== 1 + 1) { 1.44 + $ERROR('#3: var object = new Object(); object.prop = 1; var y = object.prop++; object.prop === 1 + 1. Actual: ' + (object.prop)); 1.45 + } 1.46 +} 1.47 + 1.48 + 1.49 +