S11.3.1_A5_T1.js (982B)
1 // Copyright (C) 2014 André Bargull. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: Operator x++ calls PutValue(lhs, newValue) 6 es5id: S11.3.1_A5_T1 7 description: > 8 Evaluating LeftHandSideExpression lhs returns Reference type; Reference 9 base value is an environment record and environment record kind is 10 object environment record. PutValue(lhs, newValue) uses the initially 11 created Reference even if the environment binding is no longer present. 12 Binding in surrounding function environment record is not changed. 13 flags: [noStrict] 14 ---*/ 15 16 function testFunction() { 17 var x = 0; 18 var scope = { 19 get x() { 20 delete this.x; 21 return 2; 22 } 23 }; 24 25 with (scope) { 26 x++; 27 } 28 29 if (scope.x !== 3) { 30 throw new Test262Error('#1: scope.x === 3. Actual: ' + (scope.x)); 31 } 32 if (x !== 0) { 33 throw new Test262Error('#2: x === 0. Actual: ' + (x)); 34 } 35 } 36 testFunction(); 37 38 reportCompare(0, 0);