André Bargull 0ceb428ec9 Add test coverage for identifier resolution in dynamic scopes
Identifier resolution in dynamic scope context is missing test coverage, resolves https://bugs.ecmascript.org/show_bug.cgi?id=1751 .
2014-12-10 16:05:32 -08:00

30 lines
910 B
JavaScript
Executable File

// 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)
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 object environment record is not changed.
flags: [noStrict]
---*/
var outerScope = {x: 0};
var innerScope = {x: 1};
with (outerScope) {
with (innerScope) {
x = (delete innerScope.x, 2);
}
}
if (innerScope.x !== 2) {
$ERROR('#1: innerScope.x === 2. Actual: ' + (innerScope.x));
}
if (outerScope.x !== 0) {
$ERROR('#2: outerScope.x === 0. Actual: ' + (outerScope.x));
}