internal void EnsureParameters(FunctionAnalysisUnit unit) {
     var astParams = Function.FunctionObject.ParameterDeclarations;
     if (astParams != null) {
         for (int i = 0; i < astParams.Length; ++i) {
             VariableDef param;
             if (!TryGetVariable(astParams[i].Name, out param)) {
                 param = new LocatedVariableDef(unit.ProjectEntry, astParams[i]);
                 AddVariable(astParams[i].Name, param);
             }
         }
     }
 }
        internal void EnsureParameters(FunctionAnalysisUnit unit)
        {
            var astParams = Function.FunctionObject.ParameterDeclarations;

            if (astParams != null)
            {
                for (int i = 0; i < astParams.Length; ++i)
                {
                    VariableDef param;
                    if (!TryGetVariable(astParams[i].Name, out param))
                    {
                        param = new LocatedVariableDef(unit.ProjectEntry, astParams[i]);
                        AddVariable(astParams[i].Name, param);
                    }
                }
            }
        }
        //public readonly GeneratorInfo Generator;

        public FunctionEnvironmentRecord(
            UserFunctionValue function,
            FunctionAnalysisUnit analysisUnit,
            Node node,
            EnvironmentRecord declScope,
            IJsProjectEntry declModule
        )
            : base(node, declScope) {
            _function = function;
            _this = new VariableDef();
            AnalysisUnit = analysisUnit;
#if FALSE
            if (Function.FunctionObject.IsGenerator) {
                Generator = new GeneratorInfo(function.ProjectState, declModule);
                ReturnValue.AddTypes(function.ProjectEntry, Generator.SelfSet, false);
            }
#endif
        }
        //public readonly GeneratorInfo Generator;

        public FunctionEnvironmentRecord(
            UserFunctionValue function,
            FunctionAnalysisUnit analysisUnit,
            Node node,
            EnvironmentRecord declScope,
            IJsProjectEntry declModule
            )
            : base(node, declScope)
        {
            _function    = function;
            _this        = new VariableDef();
            AnalysisUnit = analysisUnit;
#if FALSE
            if (Function.FunctionObject.IsGenerator)
            {
                Generator = new GeneratorInfo(function.ProjectState, declModule);
                ReturnValue.AddTypes(function.ProjectEntry, Generator.SelfSet, false);
            }
#endif
        }