aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/craftinginterpreters/lox/LoxInstance.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/craftinginterpreters/lox/LoxInstance.java')
-rw-r--r--src/com/craftinginterpreters/lox/LoxInstance.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/craftinginterpreters/lox/LoxInstance.java b/src/com/craftinginterpreters/lox/LoxInstance.java
index 20accaa..64989e0 100644
--- a/src/com/craftinginterpreters/lox/LoxInstance.java
+++ b/src/com/craftinginterpreters/lox/LoxInstance.java
@@ -18,7 +18,7 @@ class LoxInstance {
LoxFunction method = klass.findMethod(name.lexeme);
if (method != null)
- return method;
+ return method.bind(this);
throw new RuntimeError(name, "Undefined proprety '" + name.lexeme + "'.");
}