diff options
-rw-r--r-- | static/panes/ast-view.js | 2 | ||||
-rw-r--r-- | static/panes/cfg-view.ts | 2 | ||||
-rw-r--r-- | static/panes/compiler.js | 2 | ||||
-rw-r--r-- | static/panes/device-view.js | 2 | ||||
-rw-r--r-- | static/panes/gccdump-view.js | 2 | ||||
-rw-r--r-- | static/panes/opt-view.js | 2 | ||||
-rw-r--r-- | static/panes/pane.interfaces.ts | 3 | ||||
-rw-r--r-- | static/panes/pane.ts | 2 |
8 files changed, 10 insertions, 7 deletions
diff --git a/static/panes/ast-view.js b/static/panes/ast-view.js index de700ebbb..9ec8ff0dc 100644 --- a/static/panes/ast-view.js +++ b/static/panes/ast-view.js @@ -150,7 +150,7 @@ Ast.prototype.getDefaultPaneName = function () { }; Ast.prototype.getPaneTag = function () { - if(this._editorid !== undefined) { + if(this._editorid) { return this._compilerName + ' (Editor #' + this._editorid + ', Compiler #' + this._compilerid + ')'; } else { return this._compilerName + ' (Tree #' + this._treeid + ', Compiler #' + this._compilerid + ')'; diff --git a/static/panes/cfg-view.ts b/static/panes/cfg-view.ts index 28baee57a..fe492c956 100644 --- a/static/panes/cfg-view.ts +++ b/static/panes/cfg-view.ts @@ -298,7 +298,7 @@ export class Cfg { } getPaneTag() { - if(this._editorid !== undefined) { + if(this._editorid) { return `${this._compilerName} (Editor #${this._editorid}, Compiler #${this.compilerId})`; } else { return `${this._compilerName} (Tree #${this._treeid}, Compiler #${this.compilerId})`; diff --git a/static/panes/compiler.js b/static/panes/compiler.js index 9e0571464..107f5a238 100644 --- a/static/panes/compiler.js +++ b/static/panes/compiler.js @@ -1120,7 +1120,7 @@ Compiler.prototype.handleCompileRequestAndResult = function (request, result, ca infoLabelText = ' - ' + timeTaken + 'ms'; } - if (result.asmSize !== undefined) { + if (result.asmSize) { infoLabelText += ' (' + result.asmSize + 'B)'; } diff --git a/static/panes/device-view.js b/static/panes/device-view.js index dc4fe19db..38e34f149 100644 --- a/static/panes/device-view.js +++ b/static/panes/device-view.js @@ -225,7 +225,7 @@ DeviceAsm.prototype.updateDeviceAsm = function () { }; DeviceAsm.prototype.getPaneTag = function () { - if(this._editorId !== undefined) { + if(this._editorId) { return this._compilerName + ' (Editor #' + this._editorId + ', Compiler #' + this._compilerId + ')'; } else { return this._compilerName + ' (Tree #' + this._treeId + ', Compiler #' + this._compilerId + ')'; diff --git a/static/panes/gccdump-view.js b/static/panes/gccdump-view.js index ca2209487..b9a485a5a 100644 --- a/static/panes/gccdump-view.js +++ b/static/panes/gccdump-view.js @@ -330,7 +330,7 @@ GccDump.prototype.getDefaultPaneName = function () { }; GccDump.prototype.getPaneTag = function () { - if(this.state._editorid !== undefined) { + if(this.state._editorid) { return this._compilerName + ' (Editor #' + this.state._editorid + ', Compiler #' + this.state._compilerid + ')'; } else { diff --git a/static/panes/opt-view.js b/static/panes/opt-view.js index 2339977f8..32cb6144f 100644 --- a/static/panes/opt-view.js +++ b/static/panes/opt-view.js @@ -138,7 +138,7 @@ Opt.prototype.getDefaultPaneName = function () { }; Opt.prototype.getPaneTag = function () { - if(this._editorid !== undefined) { + if(this._editorid) { return this._compilerName + ' (Editor #' + this._editorid + ', Compiler #' + this._compilerid + ')'; } else { return this._compilerName + ' (Tree #' + this._treeid + ', Compiler #' + this._compilerid + ')'; diff --git a/static/panes/pane.interfaces.ts b/static/panes/pane.interfaces.ts index 17047df22..d8443e048 100644 --- a/static/panes/pane.interfaces.ts +++ b/static/panes/pane.interfaces.ts @@ -33,6 +33,9 @@ import * as monaco from 'monaco-editor'; export class PaneState { id: number; compilerName: string; + // editorid and treeid are truthy numbers: if they are truthy, then they + // reprsent the positive integer id associated with them. If not truthy + // there is no editor or tree view associated with this pane. editorid?: number; treeid?: number; } diff --git a/static/panes/pane.ts b/static/panes/pane.ts index 28beead0d..0f4f9f0b0 100644 --- a/static/panes/pane.ts +++ b/static/panes/pane.ts @@ -200,7 +200,7 @@ export abstract class Pane<S> { /** Generate "(Editor #1, Compiler #1)" tag */ protected getPaneTag() { const { compilerName, editorId, treeId, compilerId } = this.compilerInfo; - if(editorId !== undefined) { + if(editorId) { return `${compilerName} (Editor #${editorId}, Compiler #${compilerId})`; } else { return `${compilerName} (Tree #${treeId}, Compiler #${compilerId})`; |