JavaScript调试器(Chrome和Webstorm)总是在不存在的断点处中断

时间:2018-12-18 18:39:17

标签: javascript debugging breakpoints

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;
}

1 个答案:

答案 0 :(得分:2)

在JavaScript控制台的Source标签中,在右侧查找设置的断点。如果有,请在其中一个上Ctrl + Click,然后选择Remove all breakpoints

enter image description here