I had an object of the form obj[prop] and in the case where prop === 'name', using the syntax obj[prop] = 'xyz' was failing to set the property. Insteadm I had to delete obj[prop] first and then set it.
The code is far too much to put down here so this is a general question. Does anybody have an idea what might cause this problem? This was ONLY happening when prop === 'name'. Every other property I tried had no issues.
obj? Where is it created? is it possible thatnameis defined with a getter/setter? To check this, place a breakpoint at theobj[prop] = 'xyz';line, and trace into the code; it may take you inside a setter for this property.