コード例 #1
0
ファイル: FunctionValue.cs プロジェクト: tbscer/nodejstools
        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);
        }
コード例 #2
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);
        }
コード例 #3
0
 public BackboneExtendFunctionValue(ProjectEntry declaringEntry) :
     base(declaringEntry) {
     _prototype = (PrototypeValue)Descriptors["prototype"].Values.TypesNoCopy.First().Value;
 }