Commit 6273296
committed
fix: support ConstExpr with functions defined via expr.Function
ConstExpr panics when the named function was defined using
expr.Function() instead of being a method on the environment
struct. This is because ConstExpr only looks in the environment
object via runtime.Fetch, not in the Functions table.
Check c.Functions first and extract the appropriate function
implementation (Func, Fast, or Safe) before falling back to
the environment object lookup.
Fixes #8091 parent 3a46b19 commit 6273296
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
77 | 93 | | |
78 | 94 | | |
79 | 95 | | |
| |||
0 commit comments