3 ms·
I have seen a couple people suggesting the solution that reassigning a non-enumerable property should make it enumerable. Does anyone here have any insight on w
by shawnz 8y ago
I have seen a couple people suggesting the solution that reassigning a non-enumerable property should make it enumerable. Does anyone here have any insight on why they didn't go with that solution?
- anewhnaccount2 8y agoPossibly it's considered too difficult to move the standard to this behaviour since it's not a new feature per-se? Or I guess a change as subtle as this could also have unforeseen consequences? It does seem to me like a more elegant solution, and perhaps what the behaviour should have been in the first place.
- shawnz 8y agoI agree, it seems like it would be a perfectly reasonable behaviour and furthermore it could prevent future situations like this.
- Cakez0r 8y agoI wonder why there are non-enumerable properties in the first place? I know they can't change the behavior now, either way.
- tylerhou 8y agoIt could break the `for (var i in [0, 1, 2])` case (if a site relied on the fact that reassigning native methods doesn’t make that method enumerable).