feat(interpreter): make early return in init return this
This commit is contained in:
@@ -29,6 +29,8 @@ class PebbleFunction(PebbleCallable):
|
||||
try:
|
||||
interpreter.execute_block(self.declaration.body, env)
|
||||
except ReturnException as ret:
|
||||
if self.is_init:
|
||||
return self.closure.get_at(0, "this")
|
||||
return ret.value
|
||||
|
||||
if self.is_init:
|
||||
|
||||
Reference in New Issue
Block a user