Open
Description
π Search Terms
divergent accessors setter getter expando js jsdoc
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
π» Code
const x = {};
Object.defineProperty(x, "test", {
/** @returns {string} */
get() {
return "";
},
/** @param {number} a */
set(a) {},
});
function isolateFromExpandoAssignmentsBinding() {
x.test = 42; // error but should be OK
}
π Actual behavior
The write type of this expando member is string
π Expected behavior
The write type of this expando member should be number
since divergent accessors are allowed nowadays
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
[-]Expando object members can't define divergent accessors[/-][+]JS `Object.defineProperty` declaration can't define divergent accessors[/+]