mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
Fix #45340
This commit is contained in:
@@ -100,6 +100,10 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape {
|
||||
let clonedConfig = void 0;
|
||||
const cloneOnWriteProxy = (target: any, accessor: string): any => {
|
||||
let clonedTarget = void 0;
|
||||
const cloneTarget = () => {
|
||||
clonedConfig = clonedConfig ? clonedConfig : deepClone(config);
|
||||
clonedTarget = clonedTarget ? clonedTarget : lookUp(clonedConfig, accessor);
|
||||
};
|
||||
return isObject(target) ?
|
||||
new Proxy(target, {
|
||||
get: (target: any, property: string) => {
|
||||
@@ -114,10 +118,19 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape {
|
||||
return result;
|
||||
},
|
||||
set: (target: any, property: string, value: any) => {
|
||||
clonedConfig = clonedConfig ? clonedConfig : deepClone(config);
|
||||
clonedTarget = clonedTarget ? clonedTarget : lookUp(clonedConfig, accessor);
|
||||
cloneTarget();
|
||||
clonedTarget[property] = value;
|
||||
return true;
|
||||
},
|
||||
deleteProperty: (target: any, property: string) => {
|
||||
cloneTarget();
|
||||
delete clonedTarget[property];
|
||||
return true;
|
||||
},
|
||||
defineProperty: (target: any, property: string, descriptor: any) => {
|
||||
cloneTarget();
|
||||
Object.defineProperty(clonedTarget, property, descriptor);
|
||||
return true;
|
||||
}
|
||||
}) : target;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user