From e247f31028879980ed22c4c3a6bdda798a7db503 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 23 Aug 2017 10:11:26 -0700 Subject: [PATCH 1/2] Bind logger function before using --- src/server/typingsInstaller/typingsInstaller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index df2b6916e4bc0..e4822c16c84fd 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -149,7 +149,7 @@ namespace ts.server.typingsInstaller { } const discoverTypingsResult = JsTyping.discoverTypings( this.installTypingHost, - this.log.isEnabled() ? this.log.writeLine : undefined, + this.log.isEnabled() ? this.log.writeLine.bind(this.log) : undefined, req.fileNames, req.projectRootPath, this.safeList, From 9511afdd5322b965bedd944becd5b194f2b788d5 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 23 Aug 2017 12:00:01 -0700 Subject: [PATCH 2/2] Use lambda isntead of bind --- src/server/typingsInstaller/typingsInstaller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index e4822c16c84fd..f005ec7de8fc4 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -149,7 +149,7 @@ namespace ts.server.typingsInstaller { } const discoverTypingsResult = JsTyping.discoverTypings( this.installTypingHost, - this.log.isEnabled() ? this.log.writeLine.bind(this.log) : undefined, + this.log.isEnabled() ? (s => this.log.writeLine(s)) : undefined, req.fileNames, req.projectRootPath, this.safeList,