Add Promise.prototype.done shim

Base on our research, this is the only non-standard Q method people are
really calling. We didn’t check the really obscure stuff, but this
should cover the vast majority of issues.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2015-08-06 14:04:10 -06:00
parent 830adbdc08
commit fb341b094b

View File

@@ -873,6 +873,11 @@ class Atom extends Model
ipc.send('call-window-method', 'setAutoHideMenuBar', autoHide)
ipc.send('call-window-method', 'setMenuBarVisibility', not autoHide)
# Preserve this deprecation until 2.0. Sorry. Should have removed Q sooner.
Promise.prototype.done = (callback) ->
deprecate("Atom now uses ES6 Promises instead of Q. Call promise.then instead of promise.done")
@then(callback)
if includeDeprecatedAPIs
# Deprecated: Callers should be converted to use atom.deserializers
Atom::registerRepresentationClass = ->