Closed Xmader closed 8 months ago
The util.format code looks up all its own enumerable properties by Object.keys() then prints them out.
util.format
Object.keys()
In SpiderMonkey, when changing the stack property of an Error object, stack becomes an enumerable property, while V8 doesn't. Our util.inspect/util.format code was copied from Node.js, so it won't handle the difference.
stack
Error
util.inspect
According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack#value, the stack property is implementation dependent.
Would adding a test make sense?
The
util.format
code looks up all its own enumerable properties byObject.keys()
then prints them out.In SpiderMonkey, when changing the
stack
property of anError
object,stack
becomes an enumerable property, while V8 doesn't. Ourutil.inspect
/util.format
code was copied from Node.js, so it won't handle the difference.According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/stack#value, the
stack
property is implementation dependent.