private static IAnalysisSet BackboneExtendSpecializationImpl(FunctionValue func, Node node, AnalysisUnit unit, IAnalysisSet @this, IAnalysisSet[] args) { IAnalysisSet res = AnalysisSet.Empty; BackboneExtendFunctionValue value; if (!unit._env.GlobalEnvironment.TryGetNodeValue(NodeEnvironmentKind.ExtendCall, node, out res)) { value = new BackboneExtendFunctionValue( unit.ProjectEntry ); res = value.SelfSet; unit._env.GlobalEnvironment.AddNodeValue( NodeEnvironmentKind.ExtendCall, node, value.SelfSet ); } else { value = (BackboneExtendFunctionValue)res.First().Value; } if (@this != null) { value._instance.SetMember( node, unit, "__proto__", @this.Construct(node, unit, args) ); } if (args.Length > 0) { if (args[0].Count < unit.Analyzer.Limits.MaxMergeTypes) { foreach (var protoProps in args[0]) { ExpandoValue expandoProto = protoProps.Value as ExpandoValue; if (expandoProto != null) { value._prototype.AddLinkedValue(unit, expandoProto); } } } } if (args.Length > 1) { if (args[1].Count < unit.Analyzer.Limits.MaxMergeTypes) { foreach (var protoProps in args[1]) { ExpandoValue expandoProto = protoProps.Value as ExpandoValue; if (expandoProto != null) { value.AddLinkedValue(unit, expandoProto); } } } } return res; }