Open maciej-sielski opened 3 years ago
Please excuse my ignorance. for in has to stay in order to iterate over object's prototype properties. So the question remaining is can we ADD iteration over Object.getOwnPropertyNames(o);
?
Hi there @maciej-sielski, you could use parse-err
package for Errors. See https://www.npmjs.com/package/parse-err and https://github.com/cabinjs/parse-err
Hi guys, I have a problem with copying objects that contain Error objects. serializing Error causes to completely loosing its properties.
When you look at cloneProto function I think you could change the for clause to fetch property names
const props = Object.getOwnPropertyNames(o);
for (const k of props) {
We loose
name
but at least we havemessage
andstack
. What do you think?