From 85fa81014e046534bccecf5abdb3eb7108377b26 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Tue, 1 Aug 2017 15:25:07 -0700 Subject: [PATCH] Do not throw on top-level property access (fixes #31854) --- src/vs/workbench/api/node/extHost.api.impl.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 142d3d896ed..c662eb2c44e 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -512,7 +512,7 @@ export function createApiFactory( }; - return { + const api: typeof vscode = { version: pkg.version, // namespaces commands, @@ -523,11 +523,7 @@ export function createApiFactory( workspace, scm, debug, - get credentials() { - return proposedApiFunction(extension, () => { - return credentials; - })(); - }, + credentials, // types CancellationTokenSource: CancellationTokenSource, CodeLens: extHostTypes.CodeLens, @@ -581,6 +577,10 @@ export function createApiFactory( Task: extHostTypes.Task, ConfigurationTarget: extHostTypes.ConfigurationTarget }; + if (!extension.enableProposedApi) { + delete api.credentials; // Instead of error to avoid #31854 + } + return api; }; }