mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
We now use a Proxy to wrap zjquery elements, so that we can detect callers trying to invoke methods (or access attributes) that do not exist. We try to give useful error messages in those cases. The main impact here is that we force lots of tests to explicitly stub `length`. Also, we can't do equality checks on zjquery objects any more due to the proxy object, but the easy workaround is to compare selectors. (This is generally an unnecessary technique, anyway.) The proxy wrapper is fairly straightforward, and we just have a few special cases for things like "inspect" that happen when you try to print out objects.