pick
and omit
should preserve prototype, property descriptors, and extensibility
#5927
Labels
collections
feedback welcome
We want community's feedback on this issue or PR
suggestion
a suggestion yet to be agreed
Is your feature request related to a problem? Please describe.
I'm not sure this is classified as a bug or a feature request, but maybe rather a proposal thing.
As I wrote in #5922 (comment), I think filtering functions like
pick
andomit
should preserve the semantics of the original object as much as possible. Thus the prototype, the property descriptors, and the extensibility should be copied to the result.Describe the solution you'd like
For example, the code of
pick
should be like below:Is this an acceptable change to the APIs? If so, could someone enumerate APIs that should be rewritten?
pick
omit
The text was updated successfully, but these errors were encountered: