niutech / showModalDialog

window.showModalDialog polyfill using a <dialog> element
https://niutech.github.io/showModalDialog/demo.html
Apache License 2.0
177 stars 88 forks source link

Error with returnValue including string "$1" (using eval) #61

Open MartinAcosta-dev opened 11 months ago

MartinAcosta-dev commented 11 months ago

I'm having an error when the returnValue includes the string "$1". The replace function (using eval) converts every occurrence of this to the string "window.".

I can modify the regex deleting the capturing group and the problem is solved, but i don't know why are these capturing groups used in a first place.

Thanks!