Closed
Description
- Version: v12.12.0
- Platform: Darwin mba4.local 18.7.0 Darwin Kernel Version 18.7.0
- Subsystem: util.inspect
getters:true
works correctly on a plain object:
const util = require('util')
util.inspect.defaultOptions.getters = true
const object = {
get test () {
return 'test'
}
}
console.log(object)
Output:
{ test: [Getter: 'test'] }
But the same operation on a class instance fails to print the getter.
class Something {
get test () {
return 'test'
}
}
const something = new Something()
console.log(something)
Output:
Something {}
The output I expect to see is:
Something { test: [Getter: 'test'] }