Closed Bug 492647 Opened 17 years ago Closed 17 years ago

Attachment reminder should .test, not .exec

Categories

(Thunderbird :: Message Compose Window, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b3

People

(Reporter: philor, Assigned: philor)

References

Details

Attachments

(1 file)

Attached patch FixSplinter Review
re.exec() returns an array of the matches, which is particularly uninteresting when the re is "attached" and thus the array is ["attached"]. Since all we want is matched/didn't, .test() is perfect for us.
Attachment #377006 - Flags: review?(mkmelin+mozilla)
There is also bug 492438 though, requesting the list of matches to be displayed to the user in the dialog for information what triggered it.
matchedWords += keywordsArray[i] + " "; Reporting what matched only requires .exec() in the unlikely case that we embrace input-as-regexp and want to tell people what word was matched by their "attach(ed|ment)\s(?!to)" (and even then, I'm not quite sure that reporting the match rather than the regexp that hit would be the right thing).
Comment on attachment 377006 [details] [diff] [review] Fix Looks good. It's simple to change as appropriate in the future if needed. r=mkmelin
Attachment #377006 - Flags: review?(mkmelin+mozilla) → review+
Target Milestone: --- → Thunderbird 3.0b3
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: