Commit Graph

13 Commits

Author SHA1 Message Date
Tony Brix
54d011450f listener calls are reversed 2018-01-08 20:02:34 -06:00
Tony Brix
aabbea6542 jasmine.useRealClock() 2018-01-08 19:41:34 -06:00
Tony Brix
ec07003d39 fix timeout 2018-01-08 17:14:49 -06:00
Tony Brix
2f7de33ff0 add return value tests 2018-01-08 16:38:25 -06:00
Tony Brix
327ee33fac move test 2018-01-05 15:25:13 -06:00
Tony Brix
03d16c4f5d return promise.all from dispatch 2018-01-05 14:53:59 -06:00
Tony Brix
f66ae07470 fix tests 2018-01-05 14:53:59 -06:00
Tony Brix
b02aa369ca rebase atom.commands.onDidFinish 2018-01-05 14:53:59 -06:00
Will Binns-Smith
b7c328fd59 Clean up docs and comment wording 2017-08-28 14:49:54 -07:00
Will Binns-Smith
2ac1d54557 handleEvent -> onDidDispatch 2017-08-23 13:27:16 -07:00
Will Binns-Smith
9b995c68ec Normalize listeners at registration time; add tests for rich functions 2017-08-22 10:53:04 -07:00
Will Binns-Smith
3aa95d96d4 [Commands] Add support for rich listener objects with first-class metadata
This adds support for listener objects which, in addition to the existing callback listeners, can optionally provide a displayName ahead of time to avoid a potentially awkward humanized displayName.
2017-08-22 10:53:04 -07:00
Will Binns-Smith
ac32ffb155 Convert CommandRegistry to JavaScript
This was bootstrapped with running `decaffeinate` on both command-registry
and its spec, but involved a line-by-line eyeing and updating for idioms
and, in one case, correctness:

For some reason, copying the keys to the new dispatchedEvent in
coffeescript (command-registry.coffee:235) currently does not result in a thrown
exception, as it should when trying to write over the read-only property
`isTrusted`, so I added a check to ensure that the key did not already
exist in the new event. Moreover, other definitions of `preventDefault`,
`stopPropagation` and friends, which are also enumerable afaict, would
also overwrite the ones defined just prior (command-registry.coffee:220
and command-registry.js:325), so that check ensures we don't overwrite
those either.

Test plan: `./script/lint && ./script/test`, and a lengthy smoke test of
various commands through keybindings, command palette, and package
interfaces.

Released under CC0.
2017-08-20 20:52:43 -07:00