diff --git a/src/api/context.ts b/src/api/context.ts index 292f50ea..e42c807a 100644 --- a/src/api/context.ts +++ b/src/api/context.ts @@ -76,24 +76,16 @@ export class ContextAPI { return this._getContextManager().with(context, fn, thisArg, ...args); } - /** - * Bind a context to a target function or event emitter - * @deprecated in 0.x, will be removed in 1.x - * - * @param target function or event emitter to bind - * @param context context to bind to the event emitter or function. Defaults to the currently active context - */ - public bind(target: T, context: Context = this.active()): T { - return this._getContextManager().bind(target, context); - } - /** * Bind a context to a target function or event emitter * * @param context context to bind to the event emitter or function. Defaults to the currently active context * @param target function or event emitter to bind */ - public bind(context: Context = this.active(), target: T): T { + public bind(context: Context, target: T): T { + if (context === undefined) { + return target; + } return this._getContextManager().bind(target, context); }