Skip to content

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

Open
@jbghoul

Description

@jbghoul

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 ...

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