Ejemplo n.º 1
0
            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);
            }
Ejemplo n.º 2
0
            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);
            }
Ejemplo n.º 3
0
            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);
 }