mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Mark more fields in notebook types as readonly (#161428)
Ran into these while debugging through notebook code. Adding readonly makes it more clear the objects are not mutable In one case, we were also reversing an array passed to an event. This is not safe as it reverses in place so all event listeners will now see the reversed array
This commit is contained in:
@@ -839,7 +839,7 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD
|
||||
|
||||
private _deltaModelDecorationsImpl(oldDecorations: ICellModelDecorations[], newDecorations: ICellModelDeltaDecorations[]): ICellModelDecorations[] {
|
||||
|
||||
const mapping = new Map<number, { cell: CellViewModel; oldDecorations: string[]; newDecorations: IModelDeltaDecoration[] }>();
|
||||
const mapping = new Map<number, { cell: CellViewModel; oldDecorations: readonly string[]; newDecorations: readonly IModelDeltaDecoration[] }>();
|
||||
oldDecorations.forEach(oldDecoration => {
|
||||
const ownerId = oldDecoration.ownerId;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user