You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally macros could not leak out of the calling template, which is why the implementation could get away with indexing into the instructions of the state. Now however you can export the macros by looking them up on the state after rendering. This means that a macro can be called from a state that does not have the macro's instructions stored.
Macros are already kind of odd in how they work. Because there is no refcounting system or else for instructions (and template source), it's not possible for macros to hold a reference at the moment. The best I can do for now is to prevent the panic and error instead.
This is even harder to fix now that closures are linked to the original state. When a state is removed, the closures are cleared to avoid circular references. See #359
Description
Originally macros could not leak out of the calling template, which is why the implementation could get away with indexing into the instructions of the state. Now however you can export the macros by looking them up on the state after rendering. This means that a macro can be called from a state that does not have the macro's instructions stored.
Reproduction steps
The text was updated successfully, but these errors were encountered: