feat(interpreter): make early return in init return this

This commit is contained in:
2026-02-06 23:09:35 +01:00
parent 97f05848d9
commit 91437e30bc

View File

@@ -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: