提交 7569a9a7 编写于 作者: M Martin Aeschlimann

Javascript mode instantiated twice, issue #34

上级 4d78a2e8
......@@ -187,13 +187,17 @@ export class ModeServiceImpl implements IModeService {
if (this._activationPromises.hasOwnProperty(modeId)) {
return this._activationPromises[modeId];
}
this._activationPromises[modeId] = this._createMode(modeId).then((mode) => {
var c, e;
var promise = new TPromise((cc,ee,pp) => { c = cc; e = ee; });
this._activationPromises[modeId] = promise;
this._createMode(modeId).then((mode) => {
this._instantiatedModes[modeId] = mode;
delete this._activationPromises[modeId];
return this._instantiatedModes[modeId];
});
return this._activationPromises[modeId];
}).then(c, e);
return promise;
}
protected _createMode(modeId:string): TPromise<Modes.IMode> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册