first commit
This commit is contained in:
53
build/node_modules/prepack/lib/debugger/ReferenceMap.js
generated
vendored
Normal file
53
build/node_modules/prepack/lib/debugger/ReferenceMap.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
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; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// A map with an incrementing counter as the keys
|
||||
// Used to store references to variable collections since DebugProtocol
|
||||
// specifies fetching variable collections via unique IDs
|
||||
var ReferenceMap = exports.ReferenceMap = function () {
|
||||
function ReferenceMap() {
|
||||
_classCallCheck(this, ReferenceMap);
|
||||
|
||||
this._counter = 0;
|
||||
this._mapping = new Map();
|
||||
}
|
||||
|
||||
_createClass(ReferenceMap, [{
|
||||
key: "add",
|
||||
value: function add(value) {
|
||||
this._counter++;
|
||||
this._mapping[this._counter] = value;
|
||||
return this._counter;
|
||||
}
|
||||
}, {
|
||||
key: "get",
|
||||
value: function get(reference) {
|
||||
return this._mapping[reference];
|
||||
}
|
||||
}, {
|
||||
key: "clean",
|
||||
value: function clean() {
|
||||
this._counter = 0;
|
||||
this._mapping = new Map();
|
||||
}
|
||||
}]);
|
||||
|
||||
return ReferenceMap;
|
||||
}();
|
||||
//# sourceMappingURL=ReferenceMap.js.map
|
||||
Reference in New Issue
Block a user