Handle newlines in error messages, fixes #1495

This commit is contained in:
Roderic Day 2017-10-10 22:53:19 -04:00
parent 77378af232
commit 8fe7088398
3 changed files with 17 additions and 1 deletions

View file

@ -149,6 +149,18 @@ o.spec("ospec", function() {
})
})
o.spec('stack trace cleaner', function() {
o('handles line breaks', function() {
try {
throw new Error('line\nbreak')
} catch(error) {
var trace = o.cleanStackTrace(error.stack)
o(trace).notEquals('break')
o(trace.includes("test-ospec.js")).equals(true)
}
})
})
o.spec("async promise", function() {
var a = 0, b = 0