Пример #1
0
        public object AccessVariable(string name)
        {
            if (_depth == 0)
            {
                throw new MergeException($"Invalid request - Scope chain has 0 links");
            }

            return(_links.AccessVariable(name));
        }
Пример #2
0
        public object AccessVariable(string name)
        {
            if (_variables.TryGet(name, out object value))
            {
                return(value);
            }

            if (_children != null)
            {
                return(_children.AccessVariable(name));
            }

            throw new MergeException($"Attempted access of unknown variable: {name}");
        }