Skip to content

test(anonymous): cover caller type when anon verb calls verb on itself#8

Open
daiverd wants to merge 1 commit into
mainfrom
verb-code-by-index
Open

test(anonymous): cover caller type when anon verb calls verb on itself#8
daiverd wants to merge 1 commit into
mainfrom
verb-code-by-index

Conversation

@daiverd

@daiverd daiverd commented Jun 29, 2026

Copy link
Copy Markdown

Summary

  • Adds two tests to the anonymous suite that pin the bug fixed by MongooseMoo/barn#19
  • caller_type_is_anon_inside_anonymous: typeof(caller) == ANON inside a verb called from another verb on the same anonymous object
  • caller_equals_this_inside_anonymous: caller == this is true in that same scenario (the guard used by MCP session verbs in production databases)

Test results

Server caller_type_is_anon caller_equals_this
Toast PASS PASS
barn unpatched (master) FAIL FAIL
barn patched (barn#19) PASS PASS

Test plan

  • Both tests pass against ToastStunt
  • Both tests fail against barn master (confirming they catch the bug)
  • Both tests pass against barn fix/anon-caller-type

🤖 Generated with Claude Code

Add two tests to the anonymous suite that pin the bug fixed by barn's
fix/anon-caller-type PR:

- caller_type_is_anon_inside_anonymous: typeof(caller) == ANON inside
  a verb called from another verb on the same anonymous object
- caller_equals_this_inside_anonymous: caller == this is true in that
  same scenario (the guard used by MCP session verbs in production DBs)

Both pass on ToastStunt and on barn after the fix; both fail on barn
without the fix (caller carried OBJ type instead of ANON, so the
type-sensitive == comparison returned 0).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant