Chrome开发者工具和Webstorm javascript调试器总是会中断:
if(typeof qmLog !== "undefined"){
即使没有断点,也可以在下面的javascript文件中使用。
您是否知道如何避免这种破坏
String.prototype.toCamelCase = function() {
return this.replace(/(\_[a-z])/g, function($1) {
return $1.toUpperCase().replace('_', '');
});
};
var qm = {
/// lots of stuff here...
};
if (typeof qmLog !== "undefined") {
qm.qmLog = qmLog;
qmLog.qm = qm;
}
//if(typeof window !== "undefined" && typeof window.qmLog === "undefined"){window.qmLog = qm.qmLog;} // Need to use qm.qmLog so it's available in node.js modules
if (typeof nlp !== "undefined") {
qm.nlp = nlp;
}
if (typeof Quantimodo !== "undefined") {
qm.Quantimodo = Quantimodo;
}
if (typeof window !== "undefined") {
window.qm = qm;
qm.urlHelper.redirectToHttpsIfNecessary();
} else {
module.exports = qm;
}