Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use parse-domain with uglifyjs? #50

Closed
oldmtn opened this issue Oct 16, 2018 · 1 comment
Closed

Can't use parse-domain with uglifyjs? #50

oldmtn opened this issue Oct 16, 2018 · 1 comment

Comments

@oldmtn
Copy link

oldmtn commented Oct 16, 2018

It always popup "Unexpected token: keyword (const)" error.

function matchTld(domain, options) {
    // for potentially unrecognized tlds, try matching against custom tlds
    if (options.customTlds) {
        // try matching against a built regexp of custom tlds
        const tld = domain.match(options.customTlds);

        if (tld !== null) {
            return tld[0];
        }
    }

    const tries = (options.privateTlds ? [privateTrie] : emptyArr).concat(icannTrie);

    for (const trie of tries) {
        const tld = lookUp(trie, domain);

        if (tld !== null) {
            return "." + tld;
        }
    }

    return null;
}

The reason is that there are some ES6 keyword (such as 'const') and so on.

@jhnns
Copy link
Member

jhnns commented Oct 19, 2018

Should be fixed with v2.1.5

@jhnns jhnns closed this as completed Oct 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants