private object GetValue(object obj, ScriptObject scope) { if (base.IsStatic || base.IsLiteral) { return(base.value); } if (base.obj != obj) { JSObject obj2 = obj as JSObject; if (obj2 != null) { FieldInfo field = obj2.GetField(this.Name, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance); if (field != null) { return(field.GetValue(obj)); } if (obj2.outer_class_instance != null) { return(this.GetValue(obj2.outer_class_instance, null)); } } throw new TargetException(); } if (base.IsPublic || ((scope != null) && this.IsAccessibleFrom(scope))) { return(base.value); } if (((JSObject)base.obj).noExpando) { throw new JScriptException(JSError.NotAccessible, new Context(new DocumentContext("", null), this.Name)); } return(this.expandoValue); }
private Object GetValue(Object obj, ScriptObject scope) { if (this.IsStatic || this.IsLiteral) { return(this.value); } if (this.obj != obj) { JSObject jsob = obj as JSObject; if (jsob != null) { FieldInfo field = jsob.GetField(this.Name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { return(field.GetValue(obj)); } else if (jsob.outer_class_instance != null) { return(GetValue(jsob.outer_class_instance, null)); } } throw new TargetException(); } if (!this.IsPublic && (scope == null || !this.IsAccessibleFrom(scope))) { if (((JSObject)this.obj).noExpando) { throw new JScriptException(JSError.NotAccessible, new Context(new DocumentContext("", null), this.Name)); } else { return(this.expandoValue); } } return(this.value); }