Ejemplo n.º 1
0
        internal FunctionValue(ProjectEntry projectEntry, ExpandoValue prototype = null, string name = null)
            : base(projectEntry, projectEntry.Analyzer._functionPrototype)
        {
            if (prototype == null)
            {
                string description = null;
#if DEBUG
                if (String.IsNullOrWhiteSpace(Name ?? name))
                {
                    if (AnalysisUnit != null)
                    {
                        var loc = Locations.First();
                        description = "prototype object of " + AnalysisUnit.FullName + " " + loc.FilePath + "(" + loc.Column + ")";
                    }
                    else
                    {
                        description = "prototype object of <unknown objects>";
                    }
                }
                else
                {
                    description = "prototype object of " + (Name ?? name);
                }
#endif
                prototype = new PrototypeValue(ProjectEntry, this, description: description);
            }
            Add("prototype", prototype.Proxy);
            prototype.Add("constructor", this.Proxy);
            _instance = new InstanceValue(ProjectEntry, prototype, name);
        }
        internal FunctionValue(ProjectEntry projectEntry, ExpandoValue prototype = null, string name = null)
            : base(projectEntry, projectEntry.Analyzer._functionPrototype) {
            if (prototype == null) {
                string description = null;
#if DEBUG
                if (String.IsNullOrWhiteSpace(Name ?? name)) {
                    if (AnalysisUnit != null) {
                        var loc = Locations.First();
                        description = "prototype object of " + AnalysisUnit.FullName + " " + loc.FilePath + "(" + loc.Column + ")";
                    }
                    else {
                        description = "prototype object of <unknown objects>";
                    }
                }
                else {
                    description = "prototype object of " + (Name ?? name);
                }
#endif
                prototype = new PrototypeValue(ProjectEntry, this, description: description);
            }
            Add("prototype", prototype.Proxy);
            prototype.Add("constructor", this.Proxy);
            _instance = new InstanceValue(ProjectEntry, prototype, name);
        }