File tree 3 files changed +14
-12
lines changed
3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ module O = struct
37
37
[% raw{| function(o,foo){
38
38
for (var x in o) { foo(x) }}
39
39
| }]
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]
42
42
external get_value : Caml_obj_extern .t -> key -> Caml_obj_extern .t = " " [@@ bs.get_index]
43
43
external shallowCopy :
44
44
(_ [@ bs.as {json| {}| json}]) -> t -> t = " assign"
Original file line number Diff line number Diff line change @@ -78,9 +78,12 @@ external readAs : spawnResult ->
78
78
79
79
let caml_sys_system_command _cmd = 127
80
80
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
+ }| }]
84
87
85
88
86
89
(* 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) {
30
30
return 127 ;
31
31
}
32
32
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
+ } ) ;
40
39
41
40
function caml_sys_get_argv ( param ) {
42
41
if ( typeof process === "undefined" ) {
You can’t perform that action at this time.
0 commit comments