Skip to content

Commit 9905966

Browse files
committed
Added test
1 parent 073d1de commit 9905966

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

lib/internal/url.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,9 @@ function installObjectURLMethods() {
11051105

11061106
function revokeObjectURL(url) {
11071107

1108-
if (arguments.length === 0) throw new ERR_MISSING_ARGS('url');
1108+
if (arguments.length === 0) {
1109+
throw new ERR_MISSING_ARGS('url');
1110+
}
11091111

11101112
bindingBlob.revokeObjectURL(`${url}`);
11111113
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
const common = require('../common');
3+
const fixtures = require('../common/fixtures');
4+
5+
// Test ensures that the function receives the url argument.
6+
7+
const assert = require('node:assert');
8+
9+
assert.throws(() => {
10+
URL.revokeObjectURL();
11+
}, {
12+
code: 'ERR_MISSING_ARGS',
13+
name: 'TypeError',
14+
});

0 commit comments

Comments
 (0)