`isConstantExpression` should be combined with `isValidInConstantExpression`
These seem like they should do the same thing, but their behavior is very different. Probably that's a bug?
Alternatively, if the behavior is intended to be different, the function names should make that clear.
The former is "constant in the compiler sense", i.e., can be constant propagated. The latter is "constant-expression in the wasm spec sense", which means it can fit in a global's init etc. I agree we should rename one of them. Is there a more precise spec name for the latter perhaps? If not, maybe just adding "spec" in the name could help.
No, unfortunately the spec just describes them as "constant." We also informally use "constant initializer," though, so that might work.