From fc84c81a47039d998589372eedc95efaea42bcf7 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Fri, 30 Mar 2018 13:32:16 -0400 Subject: [PATCH] Make `@bind` the same as Surma's implementation --- src/lib/util.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/util.ts b/src/lib/util.ts index 12a3e28c..941a5222 100644 --- a/src/lib/util.ts +++ b/src/lib/util.ts @@ -39,11 +39,11 @@ export function bind(target: any, propertyKey: string, descriptor: PropertyDescr // define an instance property pointing to the bound function. // This effectively "caches" the bound prototype method as an instance property. get() { - let boundFunction = descriptor.value.bind(this); + let bound = descriptor.value.bind(this); Object.defineProperty(this, propertyKey, { - value: boundFunction + value: bound }); - return boundFunction; + return bound; } }; }