提交 2697ae50 编写于 作者: B Benjamin Pasero

web - guard against creating workbench more than once

上级 365d341e
...@@ -230,8 +230,17 @@ interface IWorkbenchConstructionOptions { ...@@ -230,8 +230,17 @@ interface IWorkbenchConstructionOptions {
* @param domElement the container to create the workbench in * @param domElement the container to create the workbench in
* @param options for setting up the workbench * @param options for setting up the workbench
*/ */
let created = false;
async function create(domElement: HTMLElement, options: IWorkbenchConstructionOptions): Promise<void> { async function create(domElement: HTMLElement, options: IWorkbenchConstructionOptions): Promise<void> {
// Assert that the workbench is not created more than once. We currently
// do not support this and require a full context switch to clean-up.
if (created) {
throw new Error('Unable to create the VSCode workbench more than once.');
} else {
created = true;
}
// Startup workbench // Startup workbench
await main(domElement, options); await main(domElement, options);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册