Merge branch 'master' into v9

This commit is contained in:
n1474335 2019-07-05 12:30:28 +01:00
commit e4e32a9c56
22 changed files with 384 additions and 264 deletions

View file

@ -256,7 +256,7 @@ class App {
for (let j = 0; j < catConf.ops.length; j++) {
const opName = catConf.ops[j];
if (!this.operations.hasOwnProperty(opName)) {
if (!(opName in this.operations)) {
log.warn(`${opName} could not be found.`);
continue;
}
@ -372,7 +372,7 @@ class App {
validFavourites(favourites) {
const validFavs = [];
for (let i = 0; i < favourites.length; i++) {
if (this.operations.hasOwnProperty(favourites[i])) {
if (favourites[i] in this.operations) {
validFavs.push(favourites[i]);
} else {
this.alert(`The operation "${Utils.escapeHtml(favourites[i])}" is no longer available. ` +

View file

@ -321,7 +321,7 @@ class Manager {
callback: callback.bind(scope || this)
};
if (this.dynamicHandlers.hasOwnProperty(eventType)) {
if (Object.prototype.hasOwnProperty.call(this.dynamicHandlers, eventType)) {
// Listener already exists, add new handler to the appropriate list
this.dynamicHandlers[eventType].push(eventConfig);
} else {

View file

@ -81,7 +81,7 @@ class SeasonalWaiter {
</div>`;
optionsBody.appendChild(optionItem);
if (!this.app.options.hasOwnProperty("clippy")) {
if (!("clippy" in this.app.options)) {
this.app.options.clippy = true;
}

View file

@ -26,11 +26,11 @@ self.handleMessage = function(e) {
*/
self.addEventListener("message", function(e) {
const r = e.data;
if (r.hasOwnProperty("file") && (r.hasOwnProperty("inputNum"))) {
if (Object.prototype.hasOwnProperty.call(r, "file") && Object.prototype.hasOwnProperty.call(r, "inputNum")) {
self.loadFile(r.file, r.inputNum);
} else if (r.hasOwnProperty("file")) {
} else if (Object.prototype.hasOwnProperty.call(r, "file")) {
self.loadFile(r.file, "");
} else if (r.hasOwnProperty("id")) {
} else if (Object.prototype.hasOwnProperty.call(r, "id")) {
self.id = r.id;
}
});