Fix 10 confirmed bugs across evaluator, object, scanner, and library#139
Merged
Conversation
- return inside for/for-in/while loops was silently swallowed: isTerminator did not include RETURN, so *object.Return fell through and iteration continued instead of propagating the return value up to the function call - compound assignment (+=, -=, etc.) panicked on index/property LHS because evaluateCompound unconditionally cast node.Left to *ast.Identifier; now delegates to evaluateIndexAssignment / evaluatePropertyAssignment - evaluateAssign dropped the error for unrecognised assignment targets by calling object.NewError without returning it - list index assignment panicked on non-number index (e.g. list["x"] = 1) due to unchecked type assertion; now returns a runtime error - division and modulo by zero: integer % 0 caused a Go runtime panic; float division silently produced +Inf; both now return a runtime error - string.find() used found[1] (first capture group) instead of found[0] (full match), panicking on regexes with no capture groups - list.first() and list.last() panicked with index out of range on empty lists; they now return null consistent with other list methods - scanner.scanString did not process backslash escape sequences, so \n \t \r \\ \" \' were stored as two-character literals in string tokens - math.max and math.min called panic() on bad arity instead of returning a structured runtime error object - trait method lookup only checked receiver.Class.Traits; now walks the full superclass chain so traits on parent classes are visible to children https://claude.ai/code/session_0136eEhe68sB3Mi22WwDLhrB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
return inside for/for-in/while loops was silently swallowed: isTerminator
did not include RETURN, so *object.Return fell through and iteration
continued instead of propagating the return value up to the function call
compound assignment (+=, -=, etc.) panicked on index/property LHS because
evaluateCompound unconditionally cast node.Left to *ast.Identifier; now
delegates to evaluateIndexAssignment / evaluatePropertyAssignment
evaluateAssign dropped the error for unrecognised assignment targets by
calling object.NewError without returning it
list index assignment panicked on non-number index (e.g. list["x"] = 1)
due to unchecked type assertion; now returns a runtime error
division and modulo by zero: integer % 0 caused a Go runtime panic;
float division silently produced +Inf; both now return a runtime error
string.find() used found[1] (first capture group) instead of found[0]
(full match), panicking on regexes with no capture groups
list.first() and list.last() panicked with index out of range on empty
lists; they now return null consistent with other list methods
scanner.scanString did not process backslash escape sequences, so \n \t
\r \ " ' were stored as two-character literals in string tokens
math.max and math.min called panic() on bad arity instead of returning
a structured runtime error object
trait method lookup only checked receiver.Class.Traits; now walks the
full superclass chain so traits on parent classes are visible to children
https://claude.ai/code/session_0136eEhe68sB3Mi22WwDLhrB