Merge pull request #1984 from RodericDay/newlines-in-error-messages

Handle newlines in error messages, fixes #1495
This commit is contained in:
Isiah Meadows 2017-10-28 20:20:34 -04:00 committed by GitHub
commit 3c608f26b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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