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

RESOLVED FIXED

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: arai, Assigned: arai)

Tracking

Production

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
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('-').
(Assignee)

Comment 1

3 years ago
Created attachment 8635960 [details] [diff] [review]
Remove use of non-standard flag argument of String.prototype.replace in inline-history.js.

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
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.