:: Developer Documentation Request Request Type: Correction Gecko Version: unspecified Technical Contact: :: Details This code sections shows the ways to call the RegExp constructor to create a new object /ab+c/i; new RegExp('ab+c', 'i'); new RegExp(/ab+c/, 'i'); I found this part "new RegExp(/ab+c/, 'i');" will throw "TypeError: Cannot supply flags when constructing one RegExp from another." I believe the correct syntax for this format is to include the flag on the end of the regex. In this case, "new RegExp(/ab+c/i);"
Hi, I tried to reproduce the TypeError but everything works fine for me. Can you please provide more information?
Yes, it worked for me too, I'm marking this as RESOLVED. jmcilhargey, feel free to reopen with more context if we are wrong!
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.