Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Use Array.includes in calendar

RESOLVED FIXED in 4.6

Status

Calendar
General
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: aryx, Assigned: aryx)

Tracking

Trunk

Details

Attachments

(1 attachment)

Created attachment 8652479 [details] [diff] [review]
patch, v1

Bug 1070767 enabled Array.includes https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes on all branches. The patch passed mozmill and xpcshell tests locally.
Attachment #8652479 - Flags: review?(philipp)
Comment on attachment 8652479 [details] [diff] [review]
patch, v1

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

r=philipp with the following fixes. Too bad the unit tests didn't catch this:

::: calendar/providers/gdata/modules/OAuth2.jsm
@@ +154,5 @@
>                        delete this.window;
>                      },
>  
>                      _checkForRedirect: function(aURL) {
> +                      if (!aURL.startsWith(this._parent.completionURI))

gdata's OAuth2.jsm doesn't shim the array/string methods. Either include the shim or keep this at indexOf.

::: calendar/providers/ics/calICSCalendar.js
@@ +665,5 @@
>  
>          function purgeBackupsByType(files, type) {
>              // filter out backups of the type we care about.
>              var filteredFiles = files.filter(
> +                v => { v.name.includes("calBackupData_"+pseudoID+"_"+type) });

If you use brackets with the arrow function, you'll need to return. I'd also prefer splitting the lines a bit differently:

var filteredFiles = files.filter(v => {
    return v.name.includes("calBackupData_" + pseudoID+"_" + type);
});
Attachment #8652479 - Flags: review?(philipp) → review+
https://hg.mozilla.org/comm-central/rev/990bb78f9284
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 4.6

Updated

2 years ago
Depends on: 1208741
You need to log in before you can comment on or make changes to this bug.