test: ensure that a function requiring conversion depends on converter
All checks were successful
/ test (pull_request) Successful in 17s

This test turned out to be a very discerning one. Adding it uncovered
  numerous bugs, large and small, in the TypeDispatcher. The most major
  one was that a Map distinguishes keys by strict equality, and hence
  since every lookup for a cached behavior was using a newly-generated array
  of types, the cache was never being hit. So it looked like methods were
  being updated as dependencies changed, when what was really happening
  was that the behavior was simply being regenerated from scratch on every
  call, which would not be performant as the prototype scaled.
  This bug is now fixed (by switching to a third-party ArrayKeyedMap), along
  with many smaller bugs too numerous to list.

  It should now be feasible to go through Pocomath and add all of the functions
  that depend on numbers and booleans only.
This commit is contained in:
Glen Whitney 2025-04-12 00:07:18 -07:00
parent bfc64f3789
commit f38a2d5e88
11 changed files with 151 additions and 61 deletions

9
pnpm-lock.yaml generated
View file

@ -7,6 +7,10 @@ settings:
importers:
.:
dependencies:
array-keyed-map:
specifier: ^2.1.3
version: 2.1.3
devDependencies:
mocha:
specifier: ^11.1.0
@ -49,6 +53,9 @@ packages:
argparse@2.0.1:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
array-keyed-map@2.1.3:
resolution: {integrity: sha512-JIUwuFakO+jHjxyp4YgSiKXSZeC0U+R1jR94bXWBcVlFRBycqXlb+kH9JHxBGcxnVuSqx5bnn0Qz9xtSeKOjiA==}
balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
@ -398,6 +405,8 @@ snapshots:
argparse@2.0.1: {}
array-keyed-map@2.1.3: {}
balanced-match@1.0.2: {}
binary-extensions@2.3.0: {}