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

Safari : Invalid regular expression, because of uglify compressing utf-8 characters #743

Open
jbghoul opened this issue Mar 7, 2022 · 0 comments · May be fixed by #744
Open

Safari : Invalid regular expression, because of uglify compressing utf-8 characters #743

jbghoul opened this issue Mar 7, 2022 · 0 comments · May be fixed by #744

Comments

@jbghoul
Copy link

jbghoul commented Mar 7, 2022

Parkour

What is wrong?

On Safari, MacOS, loading gpu.js causes an error :

SyntaxError: Invalid regular expression: range out of order in character class

Explanation

  • acorn (dependency) uses utf-8 characters to compute a RegExp
  • gpu.js uses uglify to minify sources to gpu-browser.min.js
  • by default, uglify compress utf-8 characters. See here
  • for some reason, Safari cannot evaluate the RegExp

Where does it happen?

It happen on Safari when loading gpu.js from https://cdn.jsdelivr.net/npm/[email protected]

How do we replicate the issue?

How important is this (1-5)?

2

Expected behavior (i.e. solution)

This can be fix by giving ascii_only output option to ugligy

Other Comments

Pull request in coming ...

@jbghoul jbghoul linked a pull request Mar 7, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant