mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
Clean up few more calls to object.freeze
- Fixed explicit casts hiding some type errors on object passed to `object.freeze` (too many properties or missing properties) - Remove some extra casts - Fixed casts of `Object.freeze` removing readonly
This commit is contained in:
@@ -277,7 +277,7 @@ export class ExtHostConfigProvider {
|
||||
mixin(result, config, false);
|
||||
}
|
||||
|
||||
return <vscode.WorkspaceConfiguration>Object.freeze(result);
|
||||
return Object.freeze(result);
|
||||
}
|
||||
|
||||
private _toReadonlyValue(result: any): any {
|
||||
|
||||
@@ -191,7 +191,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection {
|
||||
this._checkDisposed();
|
||||
const result = this.#data.get(uri);
|
||||
if (Array.isArray(result)) {
|
||||
return <ReadonlyArray<vscode.Diagnostic>>Object.freeze(result.slice(0));
|
||||
return Object.freeze(result.slice(0));
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ export class ExtHostDocumentSaveParticipant implements ExtHostDocumentSavePartic
|
||||
const { document, reason } = stubEvent;
|
||||
const { version } = document;
|
||||
|
||||
const event = Object.freeze(<vscode.TextDocumentWillSaveEvent>{
|
||||
const event = Object.freeze<vscode.TextDocumentWillSaveEvent>({
|
||||
document,
|
||||
reason,
|
||||
waitUntil(p: Promise<any | vscode.TextEdit[]>) {
|
||||
|
||||
Reference in New Issue
Block a user