marcrobledo / RomPatcher.js

An IPS/UPS/APS/BPS/RUP/PPF/xdelta ROM patcher made in HTML5.
https://www.marcrobledo.com/RomPatcher.js/
Other
723 stars 141 forks source link

"Invalid regular expression: invalid group specifier name" in Safari 15.0/macOS 11.6 #34

Closed zhuowei closed 2 years ago

zhuowei commented 2 years ago

When loading a file on Safari 15.0/macOS 11.6, I get:

[Error] SyntaxError: Invalid regular expression: invalid group specifier name (anonymous function) (zip.js:7) [Error] ReferenceError: Can't find variable: ZIP_MAGIC _parseROM (RomPatcher.js:188) (anonymous function) (MarcFile.js:26)

The line corresponds to https://github.com/marcrobledo/RomPatcher.js/blob/458d7297e4dc056eb00b4293ef11eff1da9f6c91/js/formats/zip.js#L7.

This works on Firefox 95.0.1.

marcrobledo commented 2 years ago

Looks like formats/zip.js does not compile due to FILTER_ROMS regex. That's why ZIP_MAGIC doesn't even get to be defined.

According to can I use the ?<! negative lookbehind prefix is not implemented in Safari. And sincerely, I don't know why. I always thought regular expressions were a standard and should implement all syntax.

marcrobledo commented 2 years ago

Fixed in 539b3080bca6637775275e6fe0ceb50b18a6fec2 :-)