Any chance to workaround the unicode variable issue with Google closure

Google closure library has issue with unicode variable name: Parser error on "combining character" (U+0307) · Issue #3639 · google/closure-compiler · GitHub and it doesn’t seem to be able to fix in a short while.

If you ClojureScript application has a dependency to libraries like lower-case , your application won’t compile. Unfortunately there is a big chance to encounter this issue nowadays as lower-case are getting more and more adoption.

Is there any chance to workaround this?

Unfortunately no.

Well, you could go and edit the file yourself and just change the problematic code.

The code is has issue with is the unicode chars in the JS object keys.

const SUPPORTED_LOCALE = {
    tr: {
        regexp: /\u0130|\u0049|\u0049\u0307/g,
        map: {
            İ: "\u0069",
            I: "\u0131",
            İ: "\u0069",
        },
    },
    az: {
        regexp: /\u0130/g,
        map: {
            İ: "\u0069",
            I: "\u0131",
            İ: "\u0069",
        },
    },
    lt: {
        regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
        map: {
            I: "\u0069\u0307",
            J: "\u006A\u0307",
            Į: "\u012F\u0307",
            Ì: "\u0069\u0307\u0300",
            Í: "\u0069\u0307\u0301",
            Ĩ: "\u0069\u0307\u0303",
        },
    },
};

So, if you instead put them in quotes everything will work just fine.

const SUPPORTED_LOCALE = {
    tr: {
        regexp: /\u0130|\u0049|\u0049\u0307/g,
        map: {
            "İ": "\u0069",
            "I": "\u0131",
            "İ": "\u0069",
        },
    },
    ...
1 Like

I will try to see if it’s possible to use npm override to specify a forked version of lower-case

Good news: lower-case is deprecated. Override change-case to 5 to get rid of it.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.