You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SetProperty doesn't handle the case where the receiver object has a non-writable property
When checking for non-writable properties while trying to set a property, we only check the object. If the receiver has a non-writable property we should throw in strict mode.
Fixes: #5948
assert.throws(()=>obj.test(),TypeError,'Class methods are strict mode code. Cannot write to non-writable properties.','Assignment to read-only properties is not allowed in strict mode');
96
+
assert.areEqual('nothing',obj.prop);
97
+
}
98
+
},
99
+
{
100
+
name: "Class member trying to write to writable property of receiver object via super-dot-assignment is fine",
assert.throws(()=>obj.test(),TypeError,'Strict mode code throws if we try to write to non-writable properties.','Assignment to read-only properties is not allowed in strict mode');
134
+
assert.areEqual('nothing',obj.prop);
135
+
}
136
+
},
137
+
{
138
+
name: "Function writing to non-writable property of receiver object via super-dot-assignment silently fails in sloppy mode",
0 commit comments