fix(hot): log messages

group arguments of operator or (||)
otherwise, nonempty string is always true
This commit is contained in:
ferhat elmas 2018-07-09 22:20:45 +02:00
parent 499cb3cec2
commit 3e03edc2cf
4 changed files with 11 additions and 8 deletions

View File

@ -40,10 +40,10 @@ if (module.hot) {
"warning",
"[HMR] Cannot apply update. Need to do a full reload!"
);
log("warning", "[HMR] " + err.stack || err.message);
log("warning", "[HMR] " + (err.stack || err.message));
window.location.reload();
} else {
log("warning", "[HMR] Update failed: " + err.stack || err.message);
log("warning", "[HMR] Update failed: " + (err.stack || err.message));
}
});
};

View File

@ -72,11 +72,11 @@ if (module.hot) {
"warning",
"[HMR] Cannot check for update. Need to do a full reload!"
);
log("warning", "[HMR] " + err.stack || err.message);
log("warning", "[HMR] " + (err.stack || err.message));
} else {
log(
"warning",
"[HMR] Update check failed: " + err.stack || err.message
"[HMR] Update check failed: " + (err.stack || err.message)
);
}
});

View File

@ -23,10 +23,13 @@ if (module.hot) {
var status = module.hot.status();
if (["abort", "fail"].indexOf(status) >= 0) {
log("warning", "[HMR] Cannot apply update.");
log("warning", "[HMR] " + err.stack || err.message);
log("warning", "[HMR] " + (err.stack || err.message));
log("warning", "[HMR] You need to restart the application!");
} else {
log("warning", "[HMR] Update failed: " + err.stack || err.message);
log(
"warning",
"[HMR] Update failed: " + (err.stack || err.message)
);
}
});
}

View File

@ -37,10 +37,10 @@ if (module.hot) {
var status = module.hot.status();
if (["abort", "fail"].indexOf(status) >= 0) {
log("warning", "[HMR] Cannot apply update.");
log("warning", "[HMR] " + err.stack || err.message);
log("warning", "[HMR] " + (err.stack || err.message));
log("warning", "[HMR] You need to restart the application!");
} else {
log("warning", "[HMR] Update failed: " + err.stack || err.message);
log("warning", "[HMR] Update failed: " + (err.stack || err.message));
}
});
};