mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
Freeze notebook doc metadata
This commit is contained in:
@@ -158,7 +158,7 @@ export class ExtHostNotebookDocument {
|
||||
data: extHostProtocol.INotebookModelAddedData
|
||||
) {
|
||||
this._notebookType = data.viewType;
|
||||
this._metadata = data.metadata ?? Object.create(null);
|
||||
this._metadata = Object.freeze(data.metadata ?? Object.create(null));
|
||||
this._spliceNotebookCells([[0, 0, data.cells]], true /* init -> no event*/);
|
||||
this._versionId = data.versionId;
|
||||
}
|
||||
@@ -207,7 +207,7 @@ export class ExtHostNotebookDocument {
|
||||
|
||||
acceptDocumentPropertiesChanged(data: extHostProtocol.INotebookDocumentPropertiesChangeData) {
|
||||
if (data.metadata) {
|
||||
this._metadata = { ...this._metadata, ...data.metadata };
|
||||
this._metadata = Object.freeze({ ...this._metadata, ...data.metadata });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user