Skip to content

Commit

Permalink
Fix conformance view state bug (compiler-explorer#5120)
Browse files Browse the repository at this point in the history
Fixes compiler-explorer#5119 where a type error happens during page load
  • Loading branch information
jeremy-rifkin authored Jun 7, 2023
1 parent 3b75a22 commit 71ae48c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions static/panes/conformance-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class Conformance extends Pane<ConformanceViewState> {
private langId: string;
private source: string;
private sourceNeedsExpanding: boolean;
private compilerPickers: CompilerEntry[];
private compilerPickers: CompilerEntry[] = [];
private expandedSourceAndFiles: SourceAndFiles | null;
private currentLibs: Lib[];
private status: ConformanceStatus;
Expand Down Expand Up @@ -308,8 +308,6 @@ export class Conformance extends Pane<ConformanceViewState> {

this.selectorList.append(newSelector);

// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!this.compilerPickers) this.compilerPickers = [];
this.compilerPickers.push(newCompilerEntry);

this.handleToolbarUI();
Expand Down Expand Up @@ -478,9 +476,6 @@ export class Conformance extends Pane<ConformanceViewState> {
}

currentState(): ConformanceViewState {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!this.compilerPickers) this.compilerPickers = [];

const compilers = this.compilerPickers.map(compilerEntry => ({
compilerId: this.getCompilerId(compilerEntry),
options: compilerEntry.optionsField?.val() || '',
Expand Down

0 comments on commit 71ae48c

Please sign in to comment.