gpu.js icon indicating copy to clipboard operation
gpu.js copied to clipboard

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

Open jbghoul opened this issue 3 years ago • 0 comments

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 avatar Mar 07 '22 16:03 jbghoul