Closed Bug 1185455 Opened 6 years ago Closed 6 years ago

Remove use of non-standard flag argument of String.prototype.replace in inline-history.js.

Categories

(bugzilla.mozilla.org Graveyard :: Extensions: InlineHistory, defect)

Production
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

3rd argument of String.prototype.replace is non-standard Mozilla-only extension, I'm going to remove it in bug 1108382.

https://git.mozilla.org/?p=webtools/bmo/bugzilla.git;a=blob;f=extensions/InlineHistory/web/inline-history.js;h=0c8293519fca847bfc359b8fbdc2f4f1ffea0ea7;hb=HEAD#l268 [github]
>   linkAttachmentFlags: function() {
>     ...
>         var flag = this.trim(match[2].replace('\u2011', '-', 'g'));
>     ...
>   }

https://git.mozilla.org/?p=webtools/bmo/bugzilla.git;a=blob;f=extensions/InlineHistory/web/inline-history.js;h=0c8293519fca847bfc359b8fbdc2f4f1ffea0ea7;hb=HEAD#l333 [github]
>   linkBugFlags: function() {
>     ...
>       var flagName = this.trim(flagLabel.innerHTML).replace('\u2011', '-', 'g');
>     ...
>   }

Those should be replaced with replace(/.../g, '-') or .split(...).join('-').
Replaced with replace(/\u2011/g, '-')
Assignee: nobody → arai.unmht
Attachment #8635960 - Flags: review?(glob)
Comment on attachment 8635960 [details] [diff] [review]
Remove use of non-standard flag argument of String.prototype.replace in inline-history.js.

Review of attachment 8635960 [details] [diff] [review]:
-----------------------------------------------------------------

awesome, thanks for this patch.  r=glob
Attachment #8635960 - Flags: review?(glob) → review+
To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   93b2e36..d988cb6  master -> master
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Product: bugzilla.mozilla.org → bugzilla.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.