From af4e34851f564f0ddf774cb66f00ac2f00fdaec6 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 25 Sep 2019 18:23:50 -0700 Subject: [PATCH] Make FileChangesEvent immutable --- src/vs/platform/files/common/files.ts | 4 ++-- src/vs/platform/files/test/node/diskFileService.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/platform/files/common/files.ts b/src/vs/platform/files/common/files.ts index 04788f62ec1..c625aad7a66 100644 --- a/src/vs/platform/files/common/files.ts +++ b/src/vs/platform/files/common/files.ts @@ -399,9 +399,9 @@ export interface IFileChange { export class FileChangesEvent { - private _changes: IFileChange[]; + private readonly _changes: readonly IFileChange[]; - constructor(changes: IFileChange[]) { + constructor(changes: readonly IFileChange[]) { this._changes = changes; } diff --git a/src/vs/platform/files/test/node/diskFileService.test.ts b/src/vs/platform/files/test/node/diskFileService.test.ts index 238ccd8ede7..3f5c57ec1a8 100644 --- a/src/vs/platform/files/test/node/diskFileService.test.ts +++ b/src/vs/platform/files/test/node/diskFileService.test.ts @@ -1918,7 +1918,7 @@ suite('Disk File Service', function () { }); } - function hasChange(changes: IFileChange[], type: FileChangeType, resource: URI): boolean { + function hasChange(changes: readonly IFileChange[], type: FileChangeType, resource: URI): boolean { return changes.some(change => change.type === type && isEqual(change.resource, resource)); }