Skip to content

Commit

Permalink
fix: bind method hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Feb 1, 2021
1 parent 28d825c commit b7d3b1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/esl-utils/decorators/bind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export function bind<T extends Function>(target: object,

get() {
// Accessing via prototype returns original function
if (this === target) {
// If the constructor property is in the context then it's not an instance
if (!this || this === target || Object.hasOwnProperty.call(this, 'constructor')) {
return fn;
}

Expand Down

0 comments on commit b7d3b1c

Please sign in to comment.