repl: make own properties shadow prototype properties
Previously, the code displayed properties backwards (e.g., showing prototype properties before own properties). It also did uniqueness checks during this processing, so these checks were done backwards.
After this change, the properties continue to be displayed backwards, but the uniqueness checks are done in the proper order.
Fixes: https://github.com/nodejs/node/issues/15199
See also: https://github.com/nodejs/node/issues/21586 which was discovered during the testing of this fix.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines