Esempio n. 1
0
        /// <summary>
        ///     Visit Function node in DFS manner.
        /// </summary>
        /// <param name="node">Function node that will be visited.</param>
        public override void Visit(RawFunctionNode node)
        {
            var scope        = _scope.GetScopeByFunction(node);
            var inScopePlace = scope.HasVisibleInvocation(node);

            if (!IsCacheable(node))
            {
                base.Visit(node);
            }
            else if (inScopePlace == InvocationVisibilityStatus.FirstCall)
            {
                Visit(new CallFunctionAndStoreValueNode(node));
            }
            else
            {
                Visit(new CachedFunctionNode(node));
            }
        }