Skip to content

Commit 614b074

Browse files
himself65targos
authored andcommitted
wasi: refactor destructuring object on constructor
PR-URL: #31185 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 5fccb50 commit 614b074

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎lib/wasi.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ class WASI {
2626
if(options===null||typeofoptions!=='object')
2727
thrownewERR_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)=>{returnString(arg);});
34-
elseif(args===undefined)
35-
args=[];
3634
else
3735
thrownewERR_INVALID_ARG_TYPE('options.args','Array',args);
3836

0 commit comments

Comments
 (0)