@abaplint/runtime 2.5.56 → 2.5.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -84,7 +84,7 @@ export declare class Statements {
84
84
  split: typeof split;
85
85
  translate: typeof translate;
86
86
  private readonly context;
87
- private traceTotals;
87
+ private readonly traceTotals;
88
88
  constructor(context: Context);
89
89
  private _trace;
90
90
  private _traceAsync;
@@ -86,24 +86,25 @@ class Statements {
86
86
  this.sort = sort_1.sort;
87
87
  this.split = split_1.split;
88
88
  this.translate = translate_1.translate;
89
- this.traceTotals = {};
90
89
  this.context = context;
90
+ this.traceTotals = {};
91
91
  }
92
92
  _trace(func, name, min, totals) {
93
+ const tt = this.traceTotals;
93
94
  const exec = (...options) => {
94
95
  const start = Date.now();
95
96
  const result = func.bind(this)(...options);
96
97
  const runtime = Date.now() - start;
97
98
  if (totals === true) {
98
- if (this.traceTotals[name] === undefined) {
99
- this.traceTotals[name] = 0;
99
+ if (tt[name] === undefined) {
100
+ tt[name] = 0;
100
101
  }
101
- this.traceTotals[name] += runtime;
102
+ tt[name] += runtime;
102
103
  }
103
104
  if (runtime >= min) {
104
105
  console.log(`STATEMENT: ${name}, ${runtime} ms`);
105
106
  if (totals === true) {
106
- console.log(JSON.stringify(this.traceTotals));
107
+ console.log(JSON.stringify(tt));
107
108
  }
108
109
  }
109
110
  return result;
@@ -111,20 +112,21 @@ class Statements {
111
112
  return exec;
112
113
  }
113
114
  _traceAsync(func, name, min, totals) {
115
+ const tt = this.traceTotals;
114
116
  const exec = async (...options) => {
115
117
  const start = Date.now();
116
118
  const result = await func.bind(this)(...options);
117
119
  const runtime = Date.now() - start;
118
120
  if (totals === true) {
119
- if (this.traceTotals[name] === undefined) {
120
- this.traceTotals[name] = 0;
121
+ if (tt[name] === undefined) {
122
+ tt[name] = 0;
121
123
  }
122
- this.traceTotals[name] += runtime;
124
+ tt[name] += runtime;
123
125
  }
124
126
  if (runtime >= min) {
125
127
  console.log(`STATEMENT: ${name}, ${runtime} ms`);
126
128
  if (totals === true) {
127
- console.log(JSON.stringify(this.traceTotals));
129
+ console.log(JSON.stringify(tt));
128
130
  }
129
131
  }
130
132
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.5.56",
3
+ "version": "2.5.57",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",