From 83f31df6f7a1c72aa874e463db93f3c1546c2d48 Mon Sep 17 00:00:00 2001 From: Mariusz Nowak Date: Tue, 12 Feb 2013 15:36:30 +0100 Subject: [PATCH] Bind function to context with 'method' option --- lib/ext/method.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ext/method.js b/lib/ext/method.js index a9fd399..9812cba 100644 --- a/lib/ext/method.js +++ b/lib/ext/method.js @@ -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]; };