first commit
This commit is contained in:
84
build/node_modules/prepack/lib/debugger/BreakpointCollection.js
generated
vendored
Normal file
84
build/node_modules/prepack/lib/debugger/BreakpointCollection.js
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.BreakpointCollection = undefined;
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
var _PerFileBreakpointMap = require("./PerFileBreakpointMap.js");
|
||||
|
||||
var _Breakpoint = require("./Breakpoint.js");
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
// Storing BreakpointStores for all source files
|
||||
var BreakpointCollection = exports.BreakpointCollection = function () {
|
||||
function BreakpointCollection() {
|
||||
_classCallCheck(this, BreakpointCollection);
|
||||
|
||||
this.breakpointMaps = new Map();
|
||||
}
|
||||
|
||||
_createClass(BreakpointCollection, [{
|
||||
key: "addBreakpoint",
|
||||
value: function addBreakpoint(filePath, lineNum) {
|
||||
var columnNum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
||||
|
||||
if (!(filePath in this.breakpointMaps)) {
|
||||
this.breakpointMaps[filePath] = new _PerFileBreakpointMap.PerFileBreakpointMap(filePath);
|
||||
}
|
||||
var breakpointMap = this.breakpointMaps[filePath];
|
||||
breakpointMap.addBreakpoint(lineNum, columnNum);
|
||||
}
|
||||
}, {
|
||||
key: "getBreakpoint",
|
||||
value: function getBreakpoint(filePath, lineNum) {
|
||||
var columnNum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
||||
|
||||
if (filePath in this.breakpointMaps) {
|
||||
var breakpointMap = this.breakpointMaps[filePath];
|
||||
return breakpointMap.getBreakpoint(lineNum, columnNum);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}, {
|
||||
key: "removeBreakpoint",
|
||||
value: function removeBreakpoint(filePath, lineNum) {
|
||||
var columnNum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
||||
|
||||
if (filePath in this.breakpointMaps) {
|
||||
this.breakpointMaps[filePath].removeBreakpoint(lineNum, columnNum);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "enableBreakpoint",
|
||||
value: function enableBreakpoint(filePath, lineNum) {
|
||||
var columnNum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
||||
|
||||
if (filePath in this.breakpointMaps) {
|
||||
this.breakpointMaps[filePath].enableBreakpoint(lineNum, columnNum);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "disableBreakpoint",
|
||||
value: function disableBreakpoint(filePath, lineNum) {
|
||||
var columnNum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
||||
|
||||
if (filePath in this.breakpointMaps) {
|
||||
this.breakpointMaps[filePath].disableBreakpoint(lineNum, columnNum);
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return BreakpointCollection;
|
||||
}();
|
||||
//# sourceMappingURL=BreakpointCollection.js.map
|
||||
Reference in New Issue
Block a user