UNPKG

906 BJavaScriptView Raw
1/**
2 * This class holds a global method index in the entire build.
3 * The index used in the 'idxInMapping' field in reported methods.
4 * @type {{ignoredMethodsMap: {}, index: number, incrementIndex: globalMethodIndexer1.incrementIndex}}
5 */
6
7function GlobalMethodIndexer () {
8 this.index = 0;
9 this.ignoredMethodsMap = {};
10}
11
12GlobalMethodIndexer.prototype.incrementIndex = function () {
13 this.index ++;
14};
15GlobalMethodIndexer.prototype.getCurrentIndex = function () {
16 return this.index;
17};
18GlobalMethodIndexer.prototype.setIgnoredMethod = function (methodIndex) {
19 this.ignoredMethodsMap[methodIndex] = true;
20};
21GlobalMethodIndexer.prototype.isMethodIgnored = function (methodIndex) {
22 return this.ignoredMethodsMap[methodIndex];
23};
24GlobalMethodIndexer.prototype.resetData = function () {
25 this.index = 0;
26 this.ignoredMethodsMap = {}
27};
28module.exports = new GlobalMethodIndexer();