greggman / twgl.js

A Tiny WebGL helper Library
http://twgljs.org
MIT License
2.61k stars 258 forks source link

throw error: "Invalid regular expression" in Safari #188

Open maplor opened 2 years ago

maplor commented 2 years ago

In version 4.20.0 & 4.21.0, this code will throw error in Safari:

https://github.com/greggman/twgl.js/blob/04d2da72f8fa78b07225068cedcda8346059a56c/src/programs.js#L870

const tokenRE = /(?=[.[\]])|(?<=[.[\]])/g;

error message: SyntaxError: Invalid regular expression: invalid group specifier name

greggman commented 2 years ago

thank you for the bug report.

https://github.com/greggman/twgl.js/commit/2a3aeff37f0e3e0b3b2d0cb3129bc360d327409c