File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 2525 (func $readdir (param anyref ) (result (ref extern ))))
2626 (import " bindings" " file_exists"
2727 (func $file_exists (param anyref ) (result (ref eq))))
28+ (import " bindings" " is_directory"
29+ (func $is_directory (param anyref ) (result (ref eq))))
2830 (import " bindings" " rename" (func $rename (param anyref ) (param anyref )))
2931 (import " jslib" " wrap" (func $wrap (param anyref ) (result (ref eq))))
3032 (import " jslib" " unwrap" (func $unwrap (param (ref eq)) (result anyref )))
141143
142144 (data $caml_sys_is_directory " caml_sys_is_directory" )
143145
144- (func (export " caml_sys_is_directory" ) (param (ref eq)) (result (ref eq))
145- ;; ZZZ
146- (call $log_str
147- (array.new_data $string $caml_sys_is_directory
148- (i32.const 0 ) (i32.const 21 )))
149- (ref.i31 (i32.const 0 )))
146+ (func (export " caml_sys_is_directory" )
147+ (param $name (ref eq)) (result (ref eq))
148+ (try
149+ (do
150+ (return
151+ (call $is_directory
152+ (call $unwrap
153+ (call $caml_jsstring_of_string (local.get $name ))))))
154+ (catch $javascript_exception
155+ (call $caml_handle_sys_error (pop externref ))
156+ (return (ref.i31 (i32.const 0 ))))))
150157)
Original file line number Diff line number Diff line change 437437 unlink : ( p ) => fs . unlinkSync ( p ) ,
438438 readdir : ( p ) => fs . readdirSync ( p ) ,
439439 file_exists : ( p ) => + fs . existsSync ( p ) ,
440+ is_directory : ( p ) => + fs . lstatSync ( p ) . isDirectory ( ) ,
440441 rename : ( o , n ) => fs . renameSync ( o , n ) ,
441442 throw : ( e ) => {
442443 throw e ;
You can’t perform that action at this time.
0 commit comments