Breaking changes
- Check global uses more strictly (#2632) (5cbbf84)
Use of global variables (in the Wasm sense) is now checked more strictly to prevent undesirable execution order. If the compiler detects that it is possible that a variable might not have been initialized when accessed, a diagnostic is produced. It cannot be ruled out that some amount of existing code will be affected, since such checks are performed at runtime in JS but are proven at compile time in AS. If encountered, the fix is to move the variable's declaration up, say before the first invocation of a function (that might call another function) accessing the variable, so it is guaranteed that it is initialized before its first use.