File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 2
2
/* global WebAssembly */
3
3
const {
4
4
ArrayIsArray,
5
- ArrayPrototypeForEach,
6
5
ArrayPrototypeMap,
6
+ ArrayPrototypePush,
7
7
FunctionPrototypeBind,
8
- ObjectKeys ,
8
+ ObjectEntries ,
9
9
Symbol,
10
10
} = primordials ;
11
11
const {
@@ -39,7 +39,7 @@ class WASI {
39
39
for ( const key in env ) {
40
40
const value = env [ key ] ;
41
41
if ( value !== undefined )
42
- envPairs . push ( `${ key } =${ value } ` ) ;
42
+ ArrayPrototypePush ( envPairs , `${ key } =${ value } ` ) ;
43
43
}
44
44
} else if ( env !== undefined ) {
45
45
throw new ERR_INVALID_ARG_TYPE ( 'options.env' , 'Object' , env ) ;
@@ -48,10 +48,9 @@ class WASI {
48
48
const preopenArray = [ ] ;
49
49
50
50
if ( typeof preopens === 'object' && preopens !== null ) {
51
- ArrayPrototypeForEach ( ObjectKeys ( preopens ) , ( key ) => {
52
- preopenArray . push ( String ( key ) ) ;
53
- preopenArray . push ( String ( preopens [ key ] ) ) ;
54
- } ) ;
51
+ for ( const [ key , value ] of ObjectEntries ( preopens ) ) {
52
+ ArrayPrototypePush ( preopenArray , String ( key ) , String ( value ) ) ;
53
+ }
55
54
} else if ( preopens !== undefined ) {
56
55
throw new ERR_INVALID_ARG_TYPE ( 'options.preopens' , 'Object' , preopens ) ;
57
56
}
You can’t perform that action at this time.
0 commit comments