-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
consoleIssues and PRs related to the console subsystem.Issues and PRs related to the console subsystem.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.
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'] }
Metadata
Metadata
Assignees
Labels
consoleIssues and PRs related to the console subsystem.Issues and PRs related to the console subsystem.feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.utilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.