/** * Creates a function type. * * @param returnType the function's return type * @param parameterTypes the parameters' types */ public FunctionType createFunctionType( JSType returnType, JSType... parameterTypes) { return createFunctionType(returnType, createParameters(parameterTypes)); }
createFunctionType( /* parameterTypes= */ createFunctionType( unknownType, createOptionalParameters( thenableType, nullType))), /* parameterTypes= */ createFunctionType( unknownType, createOptionalParameters(allType))); Node promiseParameter = IR.name("");
/** * Creates a function type. The last parameter type of the function is * considered a variable length argument. * * @param returnType the function's return type * @param parameterTypes the parameters' types */ public FunctionType createFunctionTypeWithVarArgs( JSType returnType, JSType... parameterTypes) { return createFunctionType( returnType, createParametersWithVarArgs(parameterTypes)); }
/** * Creates a function type. The last parameter type of the function is * considered a variable length argument. * * @param returnType the function's return type * @param parameterTypes the parameters' types */ public FunctionType createFunctionTypeWithVarArgs( JSType returnType, JSType... parameterTypes) { return createFunctionType( returnType, createParametersWithVarArgs(parameterTypes)); }
/** * Creates a function type. * * @param returnType the function's return type * @param parameterTypes the parameters' types */ public FunctionType createFunctionType( JSType returnType, JSType... parameterTypes) { return createFunctionType(returnType, createParameters(parameterTypes)); }
Node createZeroArgFunction(String name, Node body, @Nullable JSType returnType) { FunctionType functionType = isAddingTypes() ? registry.createFunctionType(returnType) : null; return createFunction(name, IR.paramList(), body, functionType); }
public Es7RewriteExponentialOperator(AbstractCompiler compiler) { this.compiler = compiler; if (compiler.hasTypeCheckingRun()) { JSTypeRegistry registry = compiler.getTypeRegistry(); this.numberType = registry.getNativeType(JSTypeNative.NUMBER_TYPE); this.stringType = registry.getNativeType(JSTypeNative.STRING_TYPE); // TODO(nickreid): Get the actual type of the `Math` object here in case optimizations care. this.mathType = registry.getNativeType(JSTypeNative.UNKNOWN_TYPE); this.mathPowType = registry.createFunctionType(numberType, numberType, numberType); } else { this.numberType = null; this.stringType = null; this.mathType = null; this.mathPowType = null; } this.mathPowCall = createMathPowCall(); }
functionParamBuilder.addRequiredParams( getNativeType(U2U_CONSTRUCTOR_TYPE)); FunctionType findDelegate = typeRegistry.createFunctionType( typeRegistry.createDefaultObjectUnion(delegateBaseObject), functionParamBuilder.build());
JSType programType = shouldAddTypes ? registry.createFunctionType( registry.createUnionType( voidType, JSType oldType = callTarget.getJSType(); if (oldType != null && oldType.isFunctionType()) { callTarget.setJSType(registry.createFunctionType( oldType.toMaybeFunctionType().getReturnType(), programType)); if (shouldAddTypes) { createGenerator.setJSType( registry.createFunctionType(originalGenReturnType, programType));
FunctionParamBuilder functionParamBuilder = new FunctionParamBuilder(typeRegistry); functionParamBuilder.addRequiredParams(getNativeType(U2U_CONSTRUCTOR_TYPE)); FunctionType findDelegate = typeRegistry.createFunctionType( typeRegistry.createDefaultObjectUnion(delegateBaseObject), functionParamBuilder.build());
overriddenType = typeRegistry.createFunctionType(overriddenPropType); } else if (lvalueNode.isSetterDef()) { typeRegistry.createFunctionType(getNativeType(VOID_TYPE), overriddenPropType); } else if (overriddenPropType.isFunctionType()) {
FunctionType getterType = typeRegistry.createFunctionType(objectType); codingConvention.applySingletonGetterOld(functionType, getterType, objectType);
FunctionType getterType = typeRegistry.createFunctionType(objectType); codingConvention.applySingletonGetter( new NominalTypeBuilderOti(functionType, objectType), getterType);
registry.createFunctionType(iteratorType, paramBuilder.build());