不要怂,就是干,撸起袖子干!

Commit c3f26030 by Jan Aagaard Meier

[ci skip] Add deprecation notice to eventemitter fcts on promise

1 parent d7c0ba7a
Showing with 12 additions and 0 deletions
......@@ -104,6 +104,8 @@ SequelizePromise.all = function (promises) {
*
* @param {String} evt
* @param {Function} fct
*
* @deprecated
*/
Promise.prototype.on = function(evt, fct) {
if (evt === 'success') {
......@@ -123,6 +125,8 @@ Promise.prototype.on = function(evt, fct) {
* Emit an event from the emitter
* @param {string} type The type of event
* @param {any} value(s)* All other arguments will be passed to the event listeners
*
* @deprecated
*/
Promise.prototype.emit = function(evt) {
var args = arguments.length > 1 ? Array.prototype.slice.call(arguments, 1) : [];
......@@ -159,6 +163,8 @@ Promise.prototype.emit = function(evt) {
* @method success
* @alias ok
* @return this
*
* @deprecated
*/
Promise.prototype.success =
Promise.prototype.ok = function(fct) {
......@@ -184,6 +190,8 @@ Promise.prototype.ok = function(fct) {
* @alias fail
* @alias failure
* @return this
*
* @deprecated
*/
Promise.prototype.error =
Promise.prototype.failure =
......@@ -205,6 +213,8 @@ Promise.prototype.fail = function(fct) {
* @method done
* @alias complete
* @return this
*
* @deprecated done(fct) is deprecated, done() is regular promise syntax to explicitly signal the end of a promise chain and will not be deprecated
*/
var bluebirdDone = Promise.prototype.done;
Promise.prototype.done =
......@@ -243,6 +253,8 @@ Promise.prototype.sql = function(fct) {
* @param {Object} [options]
* @param {Array} [options.events] An array of the events to proxy. Defaults to sql, error and success
* @return this
*
* @deprecated
*/
Promise.prototype.proxy = function(promise, options) {
options = Utils._.extend({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!