2014-09-08 21:23:39 +02:00
|
|
|
// Copyright (C) 2014 André Bargull. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
info: Assignment Operator calls PutValue(lref, rval)
|
2015-02-10 22:01:39 +01:00
|
|
|
es5id: S11.13.1_A5_T1
|
2014-09-08 21:23:39 +02:00
|
|
|
description: >
|
|
|
|
Evaluating LeftHandSideExpression lref returns Reference type; Reference
|
|
|
|
base value is an environment record and environment record kind is
|
|
|
|
object environment record. PutValue(lref, rval) uses the initially
|
|
|
|
created Reference even if the environment binding is no longer present.
|
|
|
|
Binding in surrounding function environment record is not changed.
|
|
|
|
flags: [noStrict]
|
|
|
|
---*/
|
|
|
|
|
|
|
|
function testFunction() {
|
|
|
|
var x = 0;
|
|
|
|
var scope = {x: 1};
|
|
|
|
|
|
|
|
with (scope) {
|
|
|
|
x = (delete scope.x, 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (scope.x !== 2) {
|
2021-07-28 22:48:39 +02:00
|
|
|
throw new Test262Error('#1: scope.x === 2. Actual: ' + (scope.x));
|
2014-09-08 21:23:39 +02:00
|
|
|
}
|
|
|
|
if (x !== 0) {
|
2021-07-28 22:48:39 +02:00
|
|
|
throw new Test262Error('#2: x === 0. Actual: ' + (x));
|
2014-09-08 21:23:39 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
testFunction();
|