|
493 | 493 | (local.get $cmd) |
494 | 494 | (global.get $no_arg)))) |
495 | 495 |
|
496 | | - (data $readdir "readdir") |
497 | | - |
498 | 496 | (func $readdir_helper (param $dir (ref eq)) (result (ref eq)) |
499 | 497 | (block $end |
500 | 498 | (return |
|
506 | 504 | (call $readdir (call $unwrap (local.get $dir))))))) |
507 | 505 | (catch $javascript_exception |
508 | 506 | (drop (pop externref)) |
509 | | - (call $throw_ebadf |
510 | | - (array.new_data $bytes $readdir |
511 | | - (i32.const 0) (i32.const 7))) |
| 507 | + (call $throw_ebadf (@string "readdir")) |
512 | 508 | (ref.i31 (i32.const 0)))))) |
513 | 509 | (call $caml_raise_end_of_file) |
514 | 510 | (ref.i31 (i32.const 0))) |
515 | 511 |
|
516 | | - (data $closedir "closedir") |
517 | | - |
518 | 512 | (func $unix_closedir (export "unix_closedir") (export "caml_unix_closedir") |
519 | 513 | (export "win_findclose") (export "caml_unix_findclose") |
520 | 514 | (param $dir (ref eq)) (result (ref eq)) |
|
523 | 517 | (call $closedir (call $unwrap (local.get $dir)))) |
524 | 518 | (catch $javascript_exception |
525 | 519 | (drop (pop externref)) |
526 | | - (call $throw_ebadf |
527 | | - (array.new_data $bytes $closedir (i32.const 0) (i32.const 8))))) |
| 520 | + (call $throw_ebadf (@string "closedir")))) |
528 | 521 | (ref.i31 (i32.const 0))) |
529 | 522 |
|
530 | 523 | (func (export "unix_readdir") (export "caml_unix_readdir") |
|
558 | 551 | (call $win_find_next (local.get $dir)) |
559 | 552 | (local.get $dir))) |
560 | 553 |
|
561 | | - (data $rewinddir_not_implemented "rewinddir not implemented") |
562 | | - |
563 | 554 | (func (export "unix_rewinddir") (export "caml_unix_rewinddir") |
564 | 555 | (param (ref eq)) (result (ref eq)) |
565 | | - (call $caml_invalid_argument |
566 | | - (array.new_data $bytes $rewinddir_not_implemented |
567 | | - (i32.const 0) (i32.const 25))) |
| 556 | + (call $caml_invalid_argument (@string "rewinddir not implemented")) |
568 | 557 | (ref.i31 (i32.const 0))) |
569 | 558 |
|
570 | 559 | (func (export "unix_unlink") (export "caml_unix_unlink") |
|
587 | 576 | (call $caml_unix_error (pop externref) (ref.null eq)))) |
588 | 577 | (ref.i31 (i32.const 0))) |
589 | 578 |
|
590 | | - (data $link "link") |
591 | | - |
592 | 579 | (func (export "unix_link") (export "caml_unix_link") |
593 | 580 | (param $follow (ref eq)) (param $d (ref eq)) (param $s (ref eq)) |
594 | 581 | (result (ref eq)) |
|
599 | 586 | (ref.i31 (i32.const 0)) |
600 | 587 | (call $get_unix_error_exn) |
601 | 588 | (ref.i31 (i32.const 25)) ;; ENOSYS |
602 | | - (array.new_data $bytes $link (i32.const 0) (i32.const 4)) |
| 589 | + (@string "link") |
603 | 590 | (global.get $no_arg))))) |
604 | 591 | (try |
605 | 592 | (do |
|
999 | 986 | (i64.add (local.get $offset) (i64.extend_i32_s (local.get $n)))) |
1000 | 987 | (ref.i31 (local.get $n))) |
1001 | 988 |
|
1002 | | - (@string $lseek "lseek") |
1003 | | - |
1004 | 989 | (func $lseek_exn (param $errno i32) (result (ref eq)) |
1005 | 990 | (array.new_fixed $block 5 |
1006 | 991 | (ref.i31 (i32.const 0)) |
1007 | 992 | (call $get_unix_error_exn) |
1008 | 993 | (ref.i31 (local.get $errno)) |
1009 | | - (global.get $lseek) |
| 994 | + (@string "lseek") |
1010 | 995 | (global.get $no_arg))) |
1011 | 996 |
|
1012 | 997 | (func $lseek |
|
0 commit comments