Skip to content

Fix 10 confirmed bugs across evaluator, object, scanner, and library#139

Merged
kaidesu merged 1 commit into
1.0from
claude/ghost-bug-review-cbi9tx
Jun 12, 2026
Merged

Fix 10 confirmed bugs across evaluator, object, scanner, and library#139
kaidesu merged 1 commit into
1.0from
claude/ghost-bug-review-cbi9tx

Conversation

@kaidesu

@kaidesu kaidesu commented Jun 12, 2026

Copy link
Copy Markdown
Member
  • 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

- 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
@kaidesu kaidesu merged commit ea4e484 into 1.0 Jun 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants