toSource(new RegExp("/slash/killed/me"))
kapouer opened this issue · comments
Jérémy Lal commented
Hi,
it gives //slash/killed/me/
which isn't evaluable.
just got bitten by this, using an old nodejs 0.10 + v8 3.14 version from debian.
Maybe 0.12 or io.js don't have that problem (i.e. properly escape regexp toString).
Marcello Bastéa-Forte commented
Yea, definitely looks like a bug in 0.10:
$ node -v
v2.3.3
$ node
> new RegExp("/slash/killed/me")
/\/slash\/killed\/me/
$ node -v
v0.10.35
$ node
> new RegExp("/slash/killed/me")
//slash/killed/me/
Maybe there's a polyfill that fixes RegExp.prototype.toString
? Or you could make one. :-)
Jérémy Lal commented
Yes, i'll PR that later
Jérémy Lal commented
It's fixed, then.
I don't want to force the hand, but maybe you can release this ?
Marcello Bastéa-Forte commented
@kapouer released as v1.0.0! added standard and updated the travis config, so let me know if this is working for you now
Jérémy Lal commented
It works all right, thank you.