| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fe5d351 commit 3d8ec8f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,4 +26,12 @@ const url = require('url'); | |||
| 26 | 26 | }); | |
| 27 | 27 | ||
| 28 | 28 | assert.throws(() => { url.parse('http://%E0%A4%A@fail'); }, | |
| 29 | - /^URIError: URI malformed$/); | ||
| 29 | + (e) => { | ||
| 30 | + // The error should be a URIError. | ||
| 31 | + if (!(e instanceof URIError)) | ||
| 32 | + return false; | ||
| 33 | + | ||
| 34 | + // The error should be from the JS engine and not from Node.js. | ||
| 35 | + // JS engine errors do not have the `code` property. | ||
| 36 | + return e.code === undefined; | ||
| 37 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments