Exemple #1
0
        public static Type Convert(BinaryReader reader)
        {
            byte res = reader.ReadByte();

            if (res == 0x40)
            {
                return(null);
            }
            else
            {
                return(WebassemblyValueType.Convert(res));
            }
        }
Exemple #2
0
        public Type EmitReturn()
        {
            if (results.Length == 0)
            {
                return(null);
            }

            if (results.Length == 1)
            {
                return(WebassemblyValueType.Convert((byte)this.results [0]));
            }

            throw new Exception("Result type array may only have length 1 in this version of Webassembly");
        }
Exemple #3
0
        public Type [] EmitParams()
        {
            if (parameters.Length == 0)
            {
                return(null);
            }

            var accum = new List <Type> ();

            foreach (var res in parameters)
            {
                accum.Add(WebassemblyValueType.Convert((byte)res));
            }

            return(accum.ToArray());
        }