No description provided.
Issue #915 - Remove duplicate object property.
Sorry about that, guidelines say to ensure an issue is open but it seems github now automatically creates an issue for each pull request. Maybe I made a dumb mistake or maybe that guideline is redundant?
can you provide a test case for the problem this solves please
Aren't we over engineering a little here, surely a duplicate key is an obvious minor deletion that can be made. The test for this would depend on the underlying node engine's support of strict mode which would tie the test case to specific versions of node. Whilst normally I also agree with an ultra-paranoid approach to testing I believe if ever something didn't warrant a test case that this is it. If you do not care about strict mode support or the extra few bytes in the file please feel free to ignore this.
Commendable attention to detail though! I get accused of the same thing by my colleagues 📦
"is more this also allows code to be used in strict mode" that I'm confused about not the duplicate message.
One of those historical relics is support for duplicate keys in object constructors. I think maybe it's because they conflict with the (I believe non-specified) notion that VMs should currently maintain key ordering.
You could put a test for this case but it would rely on the version of node being used as support for "use strict" has not always been there, so the test would lead to a false positive in earlier versions of node. I mean I could be done I suppose... but really the duplicate key to me is just an obvious neglect of the eye that should be fixed regardless of strict mode. Hope that helps, sorry for spending so much time rambling instead of just providing the test case, next time!
ah that script mode. I was confused as there is a strict mode operation on creation of collections.
What an understandable misunderstanding!