提交 bdb2c3dd 编写于 作者: A Alex Dima

Fix bad optimization

上级 3a81a7ef
......@@ -365,11 +365,6 @@ export class RPCProtocol implements IRPCProtocol {
return TPromise.wrapError<any>(errors.canceled());
}
if (cancellationToken && cancellationToken === CancellationToken.None) {
// This can never be canceled, so pretend we never even saw a cancelation token
cancellationToken = null;
}
const req = ++this._lastMessageId;
const callId = String(req);
const sendCancel = () => {
......
......@@ -129,7 +129,10 @@ suite('RPCProtocol', () => {
});
test('passing CancellationToken.None', function (done) {
delegate = (a1: number, a2: number) => a1 + 1;
delegate = (a1: number, token: CancellationToken) => {
assert.ok(!!token);
return a1 + 1;
};
bProxy.$m(4, CancellationToken.None).then((res: number) => {
assert.equal(res, 5);
done(null);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册