mirror of
https://github.com/BreizhHardware/memoizee.git
synced 2026-03-18 21:40:27 +01:00
Bind function to context with 'method' option
This commit is contained in:
@@ -34,7 +34,7 @@ require('../_base').ext.method = function (method, options, fn, configure) {
|
||||
prop.get = function () {
|
||||
if ((name !== selfName) && this.hasOwnProperty(name)) return this[name];
|
||||
options.context = this;
|
||||
descriptor.value = configure(fn, options);
|
||||
descriptor.value = configure(fn.bind(this), options);
|
||||
defineProperty(this, name, descriptor);
|
||||
return this[name];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user