Microsoft.JScript.JSFieldMethod.Invoke C# (CSharp) Method

Invoke() private method

private Invoke ( Object obj, Object thisob, BindingFlags options, Binder binder, Object parameters, CultureInfo culture ) : Object
obj Object
thisob Object
options BindingFlags
binder Binder
parameters Object
culture System.Globalization.CultureInfo
return Object
      internal override Object Invoke(Object obj, Object thisob, BindingFlags options, Binder binder, Object[] parameters, CultureInfo culture){
        bool construct = (options & BindingFlags.CreateInstance) != 0;
        bool brackets = (options & BindingFlags.GetProperty) != 0 && (options & BindingFlags.InvokeMethod) == 0;
        Object f = this.func;
        if (f == null) f = this.field.GetValue(this.obj);
        FunctionObject func = f as FunctionObject;
        JSObject jsOb = obj as JSObject;
        if (jsOb != null && func != null && func.isMethod && (func.attributes & MethodAttributes.Virtual) != 0 && 
           jsOb.GetParent() != func.enclosing_scope && ((ClassScope)func.enclosing_scope).HasInstance(jsOb)){
          LateBinding lb = new LateBinding(func.name);
          lb.obj = jsOb;
          return lb.Call(parameters, construct, brackets, ((ScriptObject)this.obj).engine);
        }
        return LateBinding.CallValue(f, parameters, construct, brackets, ((ScriptObject)this.obj).engine, thisob, binder, culture, null);
      }