From 5767393c5b38d24816f6fd064cb54e982b8a9978 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 15 Aug 2016 15:42:24 +0200 Subject: [PATCH] clone _extraLibs before handing it out, fixes #5 --- src/monaco.contribution.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/monaco.contribution.ts b/src/monaco.contribution.ts index 3a9cb6aa..7850f3de 100644 --- a/src/monaco.contribution.ts +++ b/src/monaco.contribution.ts @@ -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 {