提交 7b295d53 编写于 作者: J Joao Moreno

Merge remote-tracking branch 'origin/master' into joao/mixin

......@@ -368,9 +368,6 @@ export class ReferenceWidget extends PeekViewWidget {
if (e.browserEvent instanceof KeyboardEvent) {
// todo@joh make this a command
goto = true;
} else if (e.browserEvent instanceof MouseEvent) {
aside = e.browserEvent.ctrlKey || e.browserEvent.metaKey || e.browserEvent.altKey;
goto = e.browserEvent.detail === 2;
}
if (aside) {
onEvent(e.elements[0], 'side');
......
......@@ -70,15 +70,15 @@ suite('RPCProtocol', () => {
});
test('passing buffer as argument', function (done) {
delegate = (a1: Buffer, a2: number) => {
assert.ok(Buffer.isBuffer(a1));
return a1[a2];
delegate = (a1: VSBuffer, a2: number) => {
assert.ok(a1 instanceof VSBuffer);
return a1.buffer[a2];
};
let b = Buffer.allocUnsafe(4);
b[0] = 1;
b[1] = 2;
b[2] = 3;
b[3] = 4;
let b = VSBuffer.alloc(4);
b.buffer[0] = 1;
b.buffer[1] = 2;
b.buffer[2] = 3;
b.buffer[3] = 4;
bProxy.$m(b, 2).then((res: number) => {
assert.equal(res, 3);
done(null);
......@@ -87,19 +87,19 @@ suite('RPCProtocol', () => {
test('returning a buffer', function (done) {
delegate = (a1: number, a2: number) => {
let b = Buffer.allocUnsafe(4);
b[0] = 1;
b[1] = 2;
b[2] = 3;
b[3] = 4;
let b = VSBuffer.alloc(4);
b.buffer[0] = 1;
b.buffer[1] = 2;
b.buffer[2] = 3;
b.buffer[3] = 4;
return b;
};
bProxy.$m(4, 1).then((res: Buffer) => {
assert.ok(Buffer.isBuffer(res));
assert.equal(res[0], 1);
assert.equal(res[1], 2);
assert.equal(res[2], 3);
assert.equal(res[3], 4);
bProxy.$m(4, 1).then((res: VSBuffer) => {
assert.ok(res instanceof VSBuffer);
assert.equal(res.buffer[0], 1);
assert.equal(res.buffer[1], 2);
assert.equal(res.buffer[2], 3);
assert.equal(res.buffer[3], 4);
done(null);
}, done);
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册