| 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.4.4_A5_T5 |
| 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 |
No ReferenceError is thrown when '++x' is in strict-mode code and the |
| 13 |
original binding is no longer present. |
| 14 |
---*/ |
| 15 |
|
| 16 |
Object.defineProperty(this, "x", { |
| 17 |
configurable: true, |
| 18 |
get: function() { |
| 19 |
delete this.x; |
| 20 |
return 2; |
| 21 |
} |
| 22 |
}); |
| 23 |
|
| 24 |
(function() { |
| 25 |
"use strict"; |
| 26 |
++x; |
| 27 |
})(); |
| 28 |
|
| 29 |
if (this.x !== 3) { |
| 30 |
$ERROR('#1: this.x === 3. Actual: ' + (this.x)); |
| 31 |
} |