lib: make Error objects instantiation less vulnerable to prototype pollution
#46065
+190
−104