public TypeScriptResolver(TypeScriptTypeResolveContext context) { if (context == null) throw new ArgumentNullException("context"); this.compilation = context.Compilation; this.conversions = TypeScriptConversions.Get(compilation); this.context = context; if (context.CurrentTypeDefinition != null) currentTypeDefinitionCache = new TypeDefinitionCache(context.CurrentTypeDefinition); }
public TypeScriptResolver(ICompilation compilation) { if (compilation == null) throw new ArgumentNullException("compilation"); this.compilation = compilation; this.conversions = TypeScriptConversions.Get(compilation); this.context = new TypeScriptTypeResolveContext(compilation.MainAssembly); var pc = compilation.MainAssembly.UnresolvedAssembly as TypeScriptProjectContent; if (pc != null) { this.checkForOverflow = pc.CompilerSettings.CheckForOverflow; } }
public ResolvedUsingScope(TypeScriptTypeResolveContext context, UsingScope usingScope) { if (context == null) throw new ArgumentNullException("context"); if (usingScope == null) throw new ArgumentNullException("usingScope"); this.parentContext = context; this.usingScope = usingScope; if (usingScope.Parent != null) { if (context.CurrentUsingScope == null) throw new InvalidOperationException(); } else { if (context.CurrentUsingScope != null) throw new InvalidOperationException(); } }
private TypeScriptResolver(ICompilation compilation, TypeScriptConversions conversions, TypeScriptTypeResolveContext context, bool checkForOverflow, bool isWithinLambdaExpression, TypeDefinitionCache currentTypeDefinitionCache, ImmutableStack<IVariable> localVariableStack, ObjectInitializerContext objectInitializerStack) { this.compilation = compilation; this.conversions = conversions; this.context = context; this.checkForOverflow = checkForOverflow; this.isWithinLambdaExpression = isWithinLambdaExpression; this.currentTypeDefinitionCache = currentTypeDefinitionCache; this.localVariableStack = localVariableStack; this.objectInitializerStack = objectInitializerStack; }
TypeScriptResolver WithContext(TypeScriptTypeResolveContext newContext) { return new TypeScriptResolver(compilation, conversions, newContext, checkForOverflow, isWithinLambdaExpression, currentTypeDefinitionCache, localVariableStack, objectInitializerStack); }