Files
rust_browser/tests/external/js262/test262/language/expressions/assignment/target-member-computed-reference-undefined.js
Zachary D. Rowitsch 2240f6c518 Expand Test262 coverage to 550 tests (Phase B)
Vendor 500 new real Test262 tests (total 550), relax curation filters for
now-supported features (arrow functions, classes, destructuring, spread/rest,
for-in/of, template literals, let/const, instanceof), add automated triage
script, and track pass rate as a CI metric. 190/550 pass (34.5%).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 14:20:22 -05:00

51 lines
1.3 KiB
JavaScript

// Copyright (C) 2015 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-assignment-operators
description: Assignment Operator evaluates the value prior validating a MemberExpression's reference (undefined)
info: |
# 13.15.2 Runtime Semantics: Evaluation
AssignmentExpression : LeftHandSideExpression = AssignmentExpression
1. If LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral,
then
a. Let lref be the result of evaluating LeftHandSideExpression.
[...]
e. Perform ? PutValue(lref, rval).
# 6.2.4.5 PutValue ( V, W )
[...]
5. If IsPropertyReference(V) is true, then
a. Let baseObj be ? ToObject(V.[[Base]]).
---*/
function DummyError() { }
assert.throws(DummyError, function() {
var base = undefined;
var prop = function() {
throw new DummyError();
};
var expr = function() {
throw new Test262Error("right-hand side expression evaluated");
};
base[prop()] = expr();
});
assert.throws(DummyError, function() {
var base = undefined;
var prop = {
toString: function() {
throw new Test262Error("property key evaluated");
}
};
var expr = function() {
throw new DummyError();
};
base[prop] = expr();
});