private void AssociateToProviderGet(string providerFunctionName, IFunctionExpression providerGetFactoryFunction) { var serviceType = providerGetFactoryFunction.GetJsType(context, new JsCyclicFlowAccumulator()).GetReturnType(); var providerGetGlobalType = GetProviderGetGlobalType(providerFunctionName); var offset = context.GetDocumentStartOffset(providerGetFactoryFunction); CreateAssignmentAssociation(providerGetGlobalType, serviceType, offset); }
private void AssociateToProviderFunction(string providerFunctionName, IFunctionExpression factoryFunction) { var constructedFactoryType = factoryFunction.GetJsType(context, new JsCyclicFlowAccumulator()).GetConstructedType(JsUnresolvedTypeArray.NoList); var providerFunctionGlobalType = GetProviderFunctionGlobalType(providerFunctionName); var offset = context.GetDocumentStartOffset(factoryFunction); CreateAssignmentAssociation(providerFunctionGlobalType, constructedFactoryType, offset); }
private void ProcessModuleServiceRegistration(string serviceName, IFunctionExpression factoryFunction) { if (factoryFunction == null) { return; } // The factory function is a constructor, use the constructed type var serviceType = factoryFunction.GetJsType(context, new JsCyclicFlowAccumulator()).GetConstructedType(JsUnresolvedTypeArray.NoList); var serviceOffset = context.GetDocumentStartOffset(factoryFunction); AssociateToServiceGlobalType(serviceName, serviceType, serviceOffset); }
private void ProcessModuleServiceRegistration(string serviceName, IFunctionExpression factoryFunction) { if (factoryFunction == null) return; // The factory function is a constructor, use the constructed type // TODO: Is this right? What invocation info should I use? var serviceType = factoryFunction.GetJsType(context).GetConstructedType(JsUnresolvedTypeArray.EmptyList); var serviceOffset = context.GetDocumentStartOffset(factoryFunction); AssociateToServiceGlobalType(serviceName, serviceType, serviceOffset); }
private void AssociateToProviderGet(string providerFunctionName, IFunctionExpression providerGetFactoryFunction) { var serviceType = providerGetFactoryFunction.GetJsType(context).GetReturnType(); var providerGetGlobalType = GetProviderGetGlobalType(providerFunctionName); var offset = context.GetDocumentStartOffset(providerGetFactoryFunction); CreateAssignmentAssociation(providerGetGlobalType, serviceType, offset); }
private void AssociateToProviderFunction(string providerFunctionName, IFunctionExpression factoryFunction) { var constructedFactoryType = factoryFunction.GetJsType(context).GetConstructedType(JsUnresolvedTypeArray.EmptyList); var providerFunctionGlobalType = GetProviderFunctionGlobalType(providerFunctionName); var offset = context.GetDocumentStartOffset(factoryFunction); CreateAssignmentAssociation(providerFunctionGlobalType, constructedFactoryType, offset); }