mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
Missing coverage encountered while implementing <https://github.com/tc39/ecma262/pull/3307> in SpiderMonkey. Ensure environment lookups are performed in the correct order: - keyed-destructuring-property-reference-target-evaluation-order-with-bindings.js Ensure `delete super[elem]` steps are correctly performed: - delete/super-property-topropertykey.js - delete/super-property-uninitialized-this.js Ensure ToPropertyKey for computed property names in object literals correctly performed: - object/computed-property-name-topropertykey-before-value-evaluation.js Ensure `GetSuperBase` is executed before `ToPropertKey`: - super/prop-expr-getsuperbase-before-topropertykey-* Ensure `GetThisBinding` is executed first: - super/prop-expr-uninitialized-this-*
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
// Copyright (C) 2024 André Bargull. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-runtime-semantics-propertydefinitionevaluation
|
|
description: >
|
|
ToPropertyKey is performed before evaluating the value expression.
|
|
info: |
|
|
13.2.5.5 Runtime Semantics: PropertyDefinitionEvaluation
|
|
|
|
PropertyDefinition : PropertyName : AssignmentExpression
|
|
|
|
1. Let propKey be ? Evaluation of PropertyName.
|
|
...
|
|
6. Else,
|
|
a. Let exprValueRef be ? Evaluation of AssignmentExpression.
|
|
b. Let propValue be ? GetValue(exprValueRef).
|
|
...
|
|
9. Perform ! CreateDataPropertyOrThrow(object, propKey, propValue).
|
|
...
|
|
|
|
13.2.5.4 Runtime Semantics: Evaluation
|
|
|
|
ComputedPropertyName : [ AssignmentExpression ]
|
|
|
|
1. Let exprValue be ? Evaluation of AssignmentExpression.
|
|
2. Let propName be ? GetValue(exprValue).
|
|
3. Return ? ToPropertyKey(propName).
|
|
---*/
|
|
|
|
var value = "bad";
|
|
|
|
var key = {
|
|
toString() {
|
|
value = "ok";
|
|
return "p";
|
|
}
|
|
};
|
|
|
|
var obj = {
|
|
[key]: value
|
|
};
|
|
|
|
assert.sameValue(obj.p, "ok");
|