errors: make properties mutable
Userland code can break if it depends on a mutable `code` property for errors. Allow users to change the `code` property but do not propagate changes to the error `name`. Additionally, make `message` and `name` consistent with `Error` object (non-enumerable). Test that `console.log()` and `.toString()` calls on internal `Error` objects with mutated properties have analogous results with the standard ECMAScript `Error` objects. PR-URL: https://github.com/nodejs/node/pull/15694 Fixes: https://github.com/nodejs/node/issues/15658 Reviewed-By:Evan Lucas <evanlucas@me.com> Reviewed-By:
James M Snell <jasnell@gmail.com> Reviewed-By:
Michael Dawson <michael_dawson@ca.ibm.com>
parent
80685771
Please register or sign in to comment