I'm using lunr with es6 syntax which need babel to compile. but babel will always enable the strict mode which will make an error in following source code:
lunr.utils.warn = (function (global) {
/* eslint-disable no-console */
return function (message) {
if (global.console && console.warn) {
console.warn(message);
}
}
/* eslint-enable no-console */
})(this);
this in strict mode will be undefined instead of the window object .
By the way, I don't understand why using global.console instead of console, is it necessary for some edge case?
I'm using lunr with es6 syntax which need babel to compile. but babel will always enable the strict mode which will make an error in following source code:
thisin strict mode will be undefined instead of thewindowobject .By the way, I don't understand why using
global.consoleinstead ofconsole, is it necessary for some edge case?