Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ff47915

Browse filesBrowse 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 4ee5665 commit ff47915
Copy full SHA for ff47915

File tree

Expand file treeCollapse file tree

1 file changed

+2
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-4
lines changed
Open diff view settings
Collapse file

‎lib/wasi.js‎

Copy file name to clipboardExpand all lines: lib/wasi.js
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ class WASI {
2525
if (options === null || typeof options !== 'object')
2626
throw new ERR_INVALID_ARG_TYPE('options', 'object', options);
2727

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

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.