| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9c0c0e6 commit 8d33e5c
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -219,10 +219,14 @@ class AssertionError extends Error { | |||
| 219 | 219 | red = '\u001b[31m'; | |
| 220 | 220 | } | |
| 221 | 221 | const util = lazyUtil(); | |
| 222 | - if (actual && actual.stack && actual instanceof Error) | ||
| 222 | + if (typeof actual === 'object' && actual !== null && | ||
| 223 | + 'stack' in actual && actual instanceof Error) { | ||
| 223 | 224 | actual = `${actual.name}: ${actual.message}`; | |
| 224 | - if (expected && expected.stack && expected instanceof Error) | ||
| 225 | + } | ||
| 226 | + if (typeof expected === 'object' && expected !== null && | ||
| 227 | + 'stack' in expected && expected instanceof Error) { | ||
| 225 | 228 | expected = `${expected.name}: ${expected.message}`; | |
| 229 | + } | ||
| 226 | 230 | ||
| 227 | 231 | if (errorDiff === 0) { | |
| 228 | 232 | let res = util.inspect(actual); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments