public GlobalVariable(BinaryReader reader) { type = new GlobalType(reader); init = new InitExpr(reader); if (type.content_type != WebAssemblyHelper.GetInitExprType(init)) { throw new Exception("Global variable type and expression mismatch."); } }
public GlobalVariable(GlobalType type, InitExpr init) { this.type = type ?? throw new ArgumentException(nameof(type)); this.init = init ?? throw new ArgumentException(nameof(init)); if (type.content_type != WebAssemblyHelper.GetInitExprType(init)) { throw new Exception("Global variable type and expression mismatch."); } }