internal FunctionObject(Type t, String name, String method_name, String[] formal_parameters, JSLocalField[] fields,
bool must_save_stack_locals, bool hasArgumentsObject, String text, VsaEngine engine)
: base(engine.Globals.globalObject.originalFunction.originalPrototype, name, formal_parameters.Length){
this.engine = engine;
this.formal_parameters = formal_parameters;
this.argumentsSlotNumber = 0;
this.body = null;
TypeReflector tr = TypeReflector.GetTypeReflectorFor(Globals.TypeRefs.ToReferenceContext(t));
this.method = tr.GetMethod(method_name, BindingFlags.Public|BindingFlags.Static);
this.parameterInfos = this.method.GetParameters();
if (!CustomAttribute.IsDefined(this.method, typeof(JSFunctionAttribute), false))
this.isMethod = true;
else{
Object[] attrs = CustomAttribute.GetCustomAttributes(method, typeof(JSFunctionAttribute), false);
JSFunctionAttributeEnum attr = ((JSFunctionAttribute)attrs[0]).attributeValue;
this.isExpandoMethod = (attr & JSFunctionAttributeEnum.IsExpandoMethod) != 0;
}
this.funcContext = null;
this.own_scope = null;
this.fields = fields;
this.must_save_stack_locals = must_save_stack_locals;
this.hasArgumentsObject = hasArgumentsObject;
this.text = text;
this.attributes = MethodAttributes.Public;
this.globals = engine.Globals;
this.superConstructor = null;
this.superConstructorCall = null;
this.enclosing_scope = this.globals.ScopeStack.Peek();
this.noExpando = false;
this.clsCompliance = CLSComplianceSpec.NotAttributed;
}