Skip to content

add namespace when converting to js files #1171

Closed
@chengtie

Description

@chengtie

I use js_of_ocaml to convert an analyzer coded in OCaml to analyzejs.js. Then I use <script src="analyzejs.js"></script> in my website to load it, and call the wrapped functions on the website.

Now, I have a new version of the analyzer, let's say analyzejs-new.js. I want some part of the website to use the wrapped functions of analyzejs-new.js, and some part of the website to use the wrapped functions of analyzejs.js. As functions in analyzejs-new.js and analyzejs.js share the same name, I would need namespaces to specify if I want to use f() of analyzejs-new.js or f() of analyzejs.js.

It seems that it is complicated to add namespaces on the side of the website, when loading these 2 files. I would like to know if it is possible to add namespaces on the side of js_of_ocaml when these 2 files are being converted.

Could anyone help?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions