ghcjs / ghcjs-base

base library for GHCJS for JavaScript interaction and marshalling, used by higher level libraries like JSC
MIT License
45 stars 67 forks source link

Fix RegExp constructor #41

Closed rimmington closed 9 years ago

rimmington commented 9 years ago

Changes the RegExp constructor call to match the docs on MDN, and what works for me locally. I'm not actually sure where the original code was expected to run; hopefully this doesn't break anything.

luite commented 9 years ago

Ah this looks like a mistake on my end. Thanks for the fix, I'll probably merge it with some small adjustments.

luite commented 9 years ago

thanks, I've tweaked the code a little bit to have it use JSString literals for all flags combinations, that should optimize a little better (although in theory with all rewrite rules in place, your version might optimize to the same code if the flags are constant)