Skip to content

Commit 614b074

Browse files
himself65targos
authored andcommitted
wasi: refactor destructuring object on constructor
PR-URL: #31185 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Anto Aravinth <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 5fccb50 commit 614b074

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/wasi.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ class WASI {
2626
if (options === null || typeof options !== 'object')
2727
throw new ERR_INVALID_ARG_TYPE('options', 'object', options);
2828

29-
// eslint-disable-next-line prefer-const
30-
let { args, env, preopens } = options;
29+
const { env, preopens } = options;
30+
let { args = [] } = options;
3131

3232
if (ArrayIsArray(args))
3333
args = ArrayPrototypeMap(args, (arg) => { return String(arg); });
34-
else if (args === undefined)
35-
args = [];
3634
else
3735
throw new ERR_INVALID_ARG_TYPE('options.args', 'Array', args);
3836

0 commit comments

Comments
 (0)