From 3e0135b6b3407d56b7a25e323701ac198eb24991 Mon Sep 17 00:00:00 2001 From: Arvind Ranasaria Date: Thu, 8 Oct 2020 14:50:47 -0700 Subject: [PATCH] capture 'this' to use retrieveVariable as callback (#12828) * capture 'this' to use retrieveVariable as callback * remove change not needed for #12082 --- .../arc/src/providers/arcControllersOptionsSourceProvider.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/arc/src/providers/arcControllersOptionsSourceProvider.ts b/extensions/arc/src/providers/arcControllersOptionsSourceProvider.ts index ac1089c09d..2623ab60fa 100644 --- a/extensions/arc/src/providers/arcControllersOptionsSourceProvider.ts +++ b/extensions/arc/src/providers/arcControllersOptionsSourceProvider.ts @@ -41,7 +41,9 @@ export class ArcControllersOptionsSourceProvider implements rd.IOptionsSourcePro } getVariableValue(variableName: string, controllerLabel: string): Promise { - return this._cacheManager.getCacheEntry(JSON.stringify([variableName, controllerLabel]), this.retrieveVariable); + // capture 'this' in an arrow function object + const retrieveVariable = (key: string) => this.retrieveVariable(key); + return this._cacheManager.getCacheEntry(JSON.stringify([variableName, controllerLabel]), retrieveVariable); } private async getPassword(controller: arc.DataController): Promise {