logseq / mldoc

Another Emacs Org-mode and Markdown parser.
GNU Affero General Public License v3.0
233 stars 20 forks source link

JS output should not use `this` in strict mode #109

Open pengx17 opened 2 years ago

pengx17 commented 2 years ago

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 https://github.com/ocsigen/js_of_ocaml/issues/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?

tiensonqin commented 2 years ago

@RCmerci Any ideas?

Bad3r commented 1 year ago

@RCmerci should this issue remain open?