Merge pull request #1955 from porsager/next

Use util.inspect to log in node - fixes #1661
This commit is contained in:
Isiah Meadows 2017-09-03 13:22:34 -04:00 committed by GitHub
commit c35852a368
2 changed files with 4 additions and 0 deletions

View file

@ -44,6 +44,9 @@
- hypertext: correct handling of shared attributes object passed to `m()`. Will copy attributes when it's necessary [#1941](https://github.com/MithrilJS/mithril.js/issues/1941) [s-ilya](https://github.com/s-ilya) ([#1942](https://github.com/MithrilJS/mithril.js/pull/1942))
- Fix IE bug where active element is null causing render function to throw error. ([1943](https://github.com/MithrilJS/mithril.js/pull/1943))
#### Ospec improvements:
- Log using util.inspect to show object content instead of "[object Object]" ([#1661](https://github.com/MithrilJS/mithril.js/issues/1661), [@porsager](https://github.com/porsager))
---
### v1.1.3

View file

@ -222,6 +222,7 @@ module.exports = new function init(name) {
results.push(result)
}
function serialize(value) {
if (hasProcess) return require("util").inspect(value)
if (value === null || (typeof value === "object" && !(value instanceof Array)) || typeof value === "number") return String(value)
else if (typeof value === "function") return value.name || "<anonymous function>"
try {return JSON.stringify(value)} catch (e) {return String(value)}