Refresh master with initial release/0.24 snapshot (#332)

* Initial port of release/0.24 source code

* Fix additional headers

* Fix a typo in launch.json
This commit is contained in:
Karl Burtram
2017-12-15 15:38:57 -08:00
committed by GitHub
parent 271b3a0b82
commit 6ad0df0e3e
7118 changed files with 107999 additions and 56466 deletions

View File

@@ -179,6 +179,29 @@ suite('Event', function () {
}
});
test('reusing event function and context', function () {
let counter = 0;
function listener() {
counter += 1;
}
const context = {};
let emitter = new Emitter();
let reg1 = emitter.event(listener, context);
let reg2 = emitter.event(listener, context);
emitter.fire();
assert.equal(counter, 2);
reg1.dispose();
emitter.fire();
assert.equal(counter, 3);
reg2.dispose();
emitter.fire();
assert.equal(counter, 3);
});
test('Debounce Event', function (done: () => void) {
let doc = new Samples.Document3();
@@ -660,4 +683,4 @@ suite('Event utils', () => {
assert.deepEqual(result, [1, 2, 3, 4, 5]);
});
});
});
});