| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ede69d2 commit 4839fc4
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -978,6 +978,10 @@ class URL { | |||
| 978 | 978 | } | |
| 979 | 979 | ||
| 980 | 980 | static canParse(url, base = undefined) { | |
| 981 | + if (arguments.length === 0) { | ||
| 982 | + throw new ERR_MISSING_ARGS('url'); | ||
| 983 | + } | ||
| 984 | + | ||
| 981 | 985 | url = `${url}`; | |
| 982 | 986 | ||
| 983 | 987 | if (base !== undefined) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,12 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + require('../common'); | ||
| 4 | + const assert = require('assert'); | ||
| 5 | + | ||
| 6 | + // One argument is required | ||
| 7 | + assert.throws(() => { | ||
| 8 | + URL.canParse(); | ||
| 9 | + }, { | ||
| 10 | + code: 'ERR_MISSING_ARGS', | ||
| 11 | + name: 'TypeError' | ||
| 12 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments