Closed Bug 1300181 Opened 8 years ago Closed 8 years ago

Noticed small error on RegExp object page

Categories

(Developer Documentation Graveyard :: General, defect, P5)

All
Other
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jmcilhargey, Unassigned, NeedInfo)

References

()

Details

:: 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?
Flags: needinfo?(jmcilhargey)
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
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.