Skip to content

Commit

Permalink
Remove another hard cast on Object.create (microsoft#172958)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz authored Jan 31, 2023
1 parent 845a39b commit ab060f0
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ class ProcessListDelegate implements IListVirtualDelegate<MachineProcessInformat
}

interface IProcessItemTemplateData extends IProcessRowTemplateData {
CPU: HTMLElement;
memory: HTMLElement;
PID: HTMLElement;
readonly CPU: HTMLElement;
readonly memory: HTMLElement;
readonly PID: HTMLElement;
}

interface IProcessRowTemplateData {
name: HTMLElement;
readonly name: HTMLElement;
}

class ProcessTreeDataSource implements IDataSource<ProcessTree, ProcessInformation | MachineProcessInformation | ProcessItem | IRemoteDiagnosticError> {
Expand Down Expand Up @@ -167,15 +167,14 @@ class ProcessRenderer implements ITreeRenderer<ProcessItem, void, IProcessItemTe

templateId: string = 'process';
renderTemplate(container: HTMLElement): IProcessItemTemplateData {
const data = <IProcessItemTemplateData>Object.create(null);
const row = append(container, $('.row'));

data.name = append(row, $('.nameLabel'));
data.CPU = append(row, $('.cpu'));
data.memory = append(row, $('.memory'));
data.PID = append(row, $('.pid'));
const name = append(row, $('.nameLabel'));
const CPU = append(row, $('.cpu'));
const memory = append(row, $('.memory'));
const PID = append(row, $('.pid'));

return data;
return { name, CPU, PID, memory };
}
renderElement(node: ITreeNode<ProcessItem, void>, index: number, templateData: IProcessItemTemplateData, height: number | undefined): void {
const { element } = node;
Expand Down

0 comments on commit ab060f0

Please sign in to comment.