0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-url-revokeobjecturl.js
DylanTet 2f4065250e
url: throw error if argument length of revokeObjectURL is 0
Added a check to see if url wasn't included as an argument
which will then throw an error.

Fixes: https://github.com/nodejs/node/issues/50432
PR-URL: https://github.com/nodejs/node/pull/50433
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
2023-11-30 21:26:56 +00:00

15 lines
245 B
JavaScript

'use strict';
require('../common');
// Test ensures that the function receives the url argument.
const assert = require('node:assert');
assert.throws(() => {
URL.revokeObjectURL();
}, {
code: 'ERR_MISSING_ARGS',
name: 'TypeError',
});