File tree Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ module O = struct
3737 [% raw{| function(o,foo){
3838 for (var x in o) { foo(x) }}
3939 | }]
40-
41- let hasOwnProperty ( o : Caml_obj_extern.t ) ( key : key) : bool = ( Obj. magic o)# # hasOwnProperty(key)
40+ external hasOwnProperty :
41+ t -> key -> bool = " hasOwnProperty" [ @@ bs.send]
4242 external get_value : Caml_obj_extern .t -> key -> Caml_obj_extern .t = " " [@@ bs.get_index]
4343 external shallowCopy :
4444 (_ [@ bs.as {json| {}| json}]) -> t -> t = " assign"
Original file line number Diff line number Diff line change @@ -78,9 +78,12 @@ external readAs : spawnResult ->
7878
7979let caml_sys_system_command _cmd = 127
8080
81- let caml_sys_getcwd () =
82- if Js. typeof [% raw{| process| }] = " undefined" then " /"
83- else [% raw{| process| }]##cwd ()
81+ let caml_sys_getcwd : unit -> string = [% raw{| function(param){
82+ if (typeof process === " undefined" || process.cwd === undefined){
83+ return " /"
84+ }
85+ return process.cwd()
86+ }| }]
8487
8588
8689(* Called by {!Sys} in the toplevel, should never fail*)
Original file line number Diff line number Diff line change @@ -30,13 +30,12 @@ function caml_sys_system_command(_cmd) {
3030 return 127 ;
3131}
3232
33- function caml_sys_getcwd ( param ) {
34- if ( typeof process === "undefined" ) {
35- return "/" ;
36- } else {
37- return process . cwd ( ) ;
38- }
39- }
33+ var caml_sys_getcwd = ( function ( param ) {
34+ if ( typeof process === "undefined" || process . cwd === undefined ) {
35+ return "/"
36+ }
37+ return process . cwd ( )
38+ } ) ;
4039
4140function caml_sys_get_argv ( param ) {
4241 if ( typeof process === "undefined" ) {
You can’t perform that action at this time.
0 commit comments