Skip to content

Commit 8cd97dc

Browse files
authored
Fix caml_js_on_ie (#1493)
Recent versions of node define `navigator` but not `navigator.userAgent`.
1 parent 0df7260 commit 8cd97dc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Dev (2023-??-??) - ??
2+
3+
* Runtime: fix Dom_html.onIE (#1493)
4+
15
# 5.4.0 (2023-07-06) - Lille
26

37
## Bug fixes

runtime/jslib_js_of_ocaml.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
//Provides: caml_js_on_ie const
2323
function caml_js_on_ie () {
2424
var ua =
25-
globalThis.navigator?globalThis.navigator.userAgent:"";
25+
(globalThis.navigator&&globalThis.navigator.userAgent)
26+
?globalThis.navigator.userAgent:"";
2627
return ua.indexOf("MSIE") != -1 && ua.indexOf("Opera") != 0;
2728
}
2829

0 commit comments

Comments
 (0)