Lady [Thu, 8 Sep 2022 05:20:46 +0000 (22:20 -0700)]
Provide fake external constructor for Matcher
Classes which depend on identity for behaviours should not be exposed
because this inheritance can be modified at runtime. This commit
provides a fake Matcher constructor which simply calls the real one.
This has a side‐effect of reducing the amount of prototype modification
which this class setup entailed, at the cost of needing to manually
redefine all the properties from the internal Matcher constructor
prototype onto the external one.
Lady [Sun, 4 Sep 2022 21:47:15 +0000 (14:47 -0700)]
Treat object function args more consistently
Functions like getOwnPropertyKeys now do not require that their
arguments are objects, but *do* require that they are not null or
undefined. Similarly, toObject now throws for null and undefined
values, rather than returning an empty object. Use `toObject($ ?? {})`
if you need the old behaviour.