Do not throw on top-level property access (fixes #31854)

This commit is contained in:
Christof Marti
2017-08-01 15:25:07 -07:00
parent 3da10bb54d
commit 85fa81014e

View File

@@ -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;
};
}