diff --git a/tools/parse-processor.mjs b/tools/parse-processor.mjs index f78c4c0261..debde68665 100644 --- a/tools/parse-processor.mjs +++ b/tools/parse-processor.mjs @@ -40,7 +40,7 @@ function BYTES(bytes, total) { unitIndex++; } let result = formatNumber(value).padStart(10) + ' ' + units[unitIndex]; - if (total !== void 0 && total != 0) { + if (total !== undefined && total != 0) { result += PERCENT(bytes, total).padStart(5); } return result; @@ -161,7 +161,7 @@ class CompilationUnit { class Script extends CompilationUnit { constructor(id) { super(); - if (id === void 0 || id <= 0) { + if (id === undefined || id <= 0) { throw new Error(`Invalid id=${id} for script`); } this.file = ''; @@ -214,7 +214,7 @@ class Script extends CompilationUnit { addMissingFunktions(list) { if (this.finalized) throw 'script is finalized!'; list.forEach(fn => { - if (this.funktions[fn.start] === void 0) { + if (this.funktions[fn.start] === undefined) { this.addFunktion(fn); } }); @@ -222,8 +222,8 @@ class Script extends CompilationUnit { addFunktion(fn) { if (this.finalized) throw 'script is finalized!'; - if (fn.start === void 0) throw "Funktion has no start position"; - if (this.funktions[fn.start] !== void 0) { + if (fn.start === undefined) throw "Funktion has no start position"; + if (this.funktions[fn.start] !== undefined) { fn.print(); throw "adding same function twice to script"; } @@ -441,7 +441,7 @@ class Script extends CompilationUnit { for (let i = 1; i < metricProperties.length; i += kMetricIncrement) { let timestampPropertyName = metricProperties[i]; let timestamp = funktionOrScript[timestampPropertyName]; - if (timestamp === void 0) continue; + if (timestamp === undefined) continue; if (timestamp < start || end < timestamp) continue; timestamp -= start; let index = Math.floor(timestamp / delta); @@ -906,7 +906,7 @@ export class ParseProcessor extends LogReader { } let script = this.lookupScript(scriptId); let funktion = script.getFunktionAtStartPosition(startPosition); - if (funktion === void 0) { + if (funktion === undefined) { funktion = new Funktion(functionName, startPosition, endPosition, script); } return funktion; diff --git a/tools/system-analyzer/helper.mjs b/tools/system-analyzer/helper.mjs index bbf7a1241d..49202a7cc6 100644 --- a/tools/system-analyzer/helper.mjs +++ b/tools/system-analyzer/helper.mjs @@ -24,4 +24,4 @@ export function formatSeconds(millis) { export function delay(time) { return new Promise(resolver => setTimeout(resolver, time)); -} \ No newline at end of file +} diff --git a/tools/system-analyzer/log/log.mjs b/tools/system-analyzer/log/log.mjs index 69195d7853..c965124b39 100644 --- a/tools/system-analyzer/log/log.mjs +++ b/tools/system-analyzer/log/log.mjs @@ -20,4 +20,4 @@ export class LogEntry { static get allTypes() { throw new Error('Not implemented.'); } -} \ No newline at end of file +} diff --git a/tools/system-analyzer/log/map.mjs b/tools/system-analyzer/log/map.mjs index 46fd4c385c..e376844ca9 100644 --- a/tools/system-analyzer/log/map.mjs +++ b/tools/system-analyzer/log/map.mjs @@ -34,7 +34,7 @@ define(Array.prototype, 'last', function() { // Map Log Events class MapLogEntry extends LogEntry { - edge = void 0; + edge = undefined; children = []; depth = 0; _isDeprecated = false; @@ -80,8 +80,7 @@ class MapLogEntry extends LogEntry { } parent() { - if (this.edge === void 0) return void 0; - return this.edge.from; + return this.edge?.from; } isDeprecated() { @@ -93,7 +92,7 @@ class MapLogEntry extends LogEntry { } isRoot() { - return this.edge === void 0 || this.edge.from === void 0; + return this.edge === undefined || this.edge.from === undefined; } contains(map) { @@ -136,11 +135,11 @@ class MapLogEntry extends LogEntry { } get type() { - return this.edge === void 0 ? 'new' : this.edge.type; + return this.edge === undefined ? 'new' : this.edge.type; } isBootstrapped() { - return this.edge === void 0; + return this.edge === undefined; } getParents() { diff --git a/tools/system-analyzer/view/events.mjs b/tools/system-analyzer/view/events.mjs index 2142d4db2b..db5b72e696 100644 --- a/tools/system-analyzer/view/events.mjs +++ b/tools/system-analyzer/view/events.mjs @@ -69,4 +69,4 @@ export class ToolTipEvent extends CustomEvent { get positionOrTargetNode() { return this._positionOrTargetNode; } -} \ No newline at end of file +} diff --git a/tools/system-analyzer/view/map-panel/map-transitions.mjs b/tools/system-analyzer/view/map-panel/map-transitions.mjs index 2b19314697..e983ff1805 100644 --- a/tools/system-analyzer/view/map-panel/map-transitions.mjs +++ b/tools/system-analyzer/view/map-panel/map-transitions.mjs @@ -87,7 +87,7 @@ DOM.defineCustomElement( } _addMapAndParentTransitions(map) { - if (map === void 0) return; + if (map === undefined) return; if (this._displayedMapsInTree.has(map)) return; this._displayedMapsInTree.add(map); this.currentNode = this.transitionView; @@ -191,7 +191,7 @@ DOM.defineCustomElement( // Add subtransitions except the one that's already shown. let visibleTransitionMap = subtransitionNodes.length == 1 ? transitionsNode.querySelector('.map').map : - void 0; + undefined; map.children.forEach((edge) => { if (edge.to != visibleTransitionMap) { this.currentNode = transitionsNode; diff --git a/tools/system-analyzer/view/source-panel.mjs b/tools/system-analyzer/view/source-panel.mjs index b4b6aabcad..c2fdac616a 100644 --- a/tools/system-analyzer/view/source-panel.mjs +++ b/tools/system-analyzer/view/source-panel.mjs @@ -249,4 +249,4 @@ class LineBuilder { marker.onmouseover = this._mouseoverHandler; return marker; } -} \ No newline at end of file +}