Bug 1610653 - Part 9: Do not use global this property assignment to define global variable in testing/modules. r=mossop

Differential Revision: https://phabricator.services.mozilla.com/D144116
This commit is contained in:
Tooru Fujisawa 2022-05-30 15:19:38 +00:00
Родитель b2f0fcf3c4
Коммит acaf6f75b5
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -31,14 +31,14 @@ const { ObjectUtils } = ChromeUtils.import(
* test-only modules. This is false when the reporter is set by content scripts,
* because they may still run in the parent process.
*/
var Assert = (this.Assert = function(reporterFunc, isDefault) {
function Assert(reporterFunc, isDefault) {
if (reporterFunc) {
this.setReporter(reporterFunc);
}
if (isDefault) {
Assert.setReporter(reporterFunc);
}
});
}
// This allows using the Assert object as an additional global instance.
Object.setPrototypeOf(Assert, Assert.prototype);