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
What was the original motivation to make everything untyped inside custom functions?
Because values are resolved in imaginary child elements nothing leaks out when a function is evaluated.
I can imagine that when the types are preserved it is possible to break custom functions by registering seemingly unrelated properties.
So maybe it should be possible to do local registrations?
The text was updated successfully, but these errors were encountered:
What was the original motivation to make everything untyped inside custom functions?
To avoid locals inside of functions having to be aware of all properties defined outside, or having to be defensively named to avoid collisions.
It would suck to write a re-usable function that used a local --foo variable to hold some intermediate calculation, and have that function straight up fail to work, unpredictably, on certain pages because that page also uses --foo for something and registered it with an incompatible type.
Also, arguments establish local variables, and they have a type, which has no need to be consistent with outside registrations either.
See: #12315
I also found it a bit surprising that there is no way to have local typed custom properties. (except
result
)What was the original motivation to make everything untyped inside custom functions?
Because values are resolved in imaginary child elements nothing leaks out when a function is evaluated.
I can imagine that when the types are preserved it is possible to break custom functions by registering seemingly unrelated properties.
So maybe it should be possible to do local registrations?
The text was updated successfully, but these errors were encountered: