Exemple #1
0
        public Dictionary <string, string> GetFunctions()// js.Eval("f=function(x,y){return x+y;}");!!!! важно, что НЕ new function
        {
            var res = new Dictionary <string, string>();

            foreach (var v in _scope.GetFields(BindingFlags.Public).Select(x => new { Name = x.Name, Val = x.GetValue(x) }).Where(x => x.Val is Closure))
            {
                res.Add(v.Name, v.Name + (v.Val + "").Substring(8, (v.Val + "").IndexOf('{') - 8));
            }
            return(res);
        }