clone _extraLibs before handing it out, fixes #5

This commit is contained in:
Johannes Rieken 2016-08-15 15:42:24 +02:00
parent 13035407db
commit 5767393c5b

View file

@ -32,7 +32,11 @@ export class LanguageServiceDefaultsImpl implements monaco.languages.typescript.
}
get extraLibs(): { [path: string]: string; } {
return Object.freeze(this._extraLibs);
const result = Object.create(null);
for (var key in this._extraLibs) {
result[key] = this._extraLibs[key];
}
return Object.freeze(result);
}
addExtraLib(content: string, filePath?: string): IDisposable {