logseq/mldoc

JS output should not use `this` in strict mode

pengx17 opened this issue · 2 comments

When I try to use this repo in the browser, I see an error related to the output that it uses this instead of globalThis or window.

See the last line of https://unpkg.com/mldoc@1.1.8/index.js
The whole js is an IIFE like this:

(function(joo_global_object)
  (function(){return this}()));

This may be related to ocsigen/js_of_ocaml#699

There is a potential fix to add wrap-with-fun flag or command, but I do not understand OCaml or its tools. In the test I do a manual patch to mldoc instead. Not sure if the issue will fixed by logseq team or not?

@RCmerci Any ideas?

Bad3r commented

@RCmerci should this issue remain open?