public BoundClosureField AddField(IBoundType type) { if (type == null) throw new ArgumentNullException("type"); var field = new BoundClosureField(this, type); _fields.Add(field); return field; }
public Scope(CodeGenerator generator, ILBuilder il, bool isFunction, BoundBody body, BoundClosureField argumentsClosureField, ITypeBuilder typeBuilder, Scope parent) { IL = il; ArgumentsClosureField = argumentsClosureField; Generator = generator; _isFunction = isFunction; _body = body; if (argumentsClosureField != null) ArgumentsEmitter = new ClosureFieldEmitter(generator, argumentsClosureField); TypeBuilder = typeBuilder; Parent = parent; _isStatic = TypeBuilder is IScriptBuilder; if (body.MappedArguments != null) _arguments = body.MappedArguments.ToDictionary(p => p.Argument, p => p.Mapped); BreakTargets = new Stack<NamedLabel>(); ContinueTargets = new Stack<NamedLabel>(); }
public ClosureFieldEmitter(CodeGenerator generator, BoundClosureField field) : base(generator, field.Type) { _field = field; }