mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
Untyped code called a method of a compiled class instance through the site's dispatch helper: the callback that resolves own function-valued properties, then the helper, which normalizes the capsule, tests each class key and unwraps the instance before calling the method. A call of a method dispatch helper from a dynamic-tier function now tests the receiver's capsule key against the helper's plain class branches (a direct call of one method with the helper's arguments) and calls that branch's method with the capsule's instance. A branch qualifies when every subclass the normalization can rebox its key to calls the same method, and when the callback has no branch for the key or those subclasses, so it answers undefined for the capsule. Every other receiver calls the callback before the arguments and then the helper, as before. Module initializers call this way only inside loops.