diff options
author | Giora Guttsait <giora111@gmail.com> | 2022-01-25 02:17:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-25 02:17:37 +0300 |
commit | b27ae24dcc4251bad726d9d84baf678d1f707fed (patch) | |
tree | 7d87194a6711e1899518a12daf2dce2cdcdcb582 /test | |
parent | 5d88f59fdb68c4f17b1ebec295cdc1723886f493 (diff) |
lib: throw error in structuedClone when no arguments are passed
PR-URL: https://github.com/nodejs/node/pull/41651
Fixes: https://github.com/nodejs/node/issues/41450
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-structuredClone-global.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/parallel/test-structuredClone-global.js b/test/parallel/test-structuredClone-global.js index ae6120c04e0..95dab1e8e89 100644 --- a/test/parallel/test-structuredClone-global.js +++ b/test/parallel/test-structuredClone-global.js @@ -5,10 +5,12 @@ require('../common'); const { - structuredClone: _structuredClone + structuredClone: _structuredClone, } = require('internal/structured_clone'); + const { - strictEqual + strictEqual, + throws, } = require('assert'); strictEqual(globalThis.structuredClone, _structuredClone); @@ -17,3 +19,5 @@ strictEqual(globalThis.structuredClone, undefined); // Restore the value for the known globals check. structuredClone = _structuredClone; + +throws(() => _structuredClone(), /ERR_MISSING_ARGS/); |