File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
AngleSharp.Scripting.JavaScript Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public DomNodeInstance(EngineInstance engine, Object value)
20
20
{
21
21
_engine = engine ;
22
22
_value = value ;
23
- SetMembers ( value . GetType ( ) ) ;
23
+ SetAllMembers ( value . GetType ( ) ) ;
24
24
25
25
// DOM objects can have properties added dynamically
26
26
Extensible = true ;
@@ -53,14 +53,23 @@ public override PropertyDescriptor GetOwnProperty(String propertyName)
53
53
return base . GetOwnProperty ( propertyName ) ;
54
54
}
55
55
56
- void SetMembers ( Type type )
56
+ void SetAllMembers ( Type type )
57
57
{
58
- if ( type . GetCustomAttribute < DomNameAttribute > ( ) == null )
58
+ var types = new List < Type > ( type . GetInterfaces ( ) ) ;
59
+
60
+ do
59
61
{
60
- foreach ( var contract in type . GetInterfaces ( ) )
61
- SetMembers ( contract ) ;
62
+ types . Add ( type ) ;
63
+ type = type . BaseType ;
62
64
}
63
- else
65
+ while ( type != null ) ;
66
+
67
+ SetMembers ( types ) ;
68
+ }
69
+
70
+ void SetMembers ( IEnumerable < Type > types )
71
+ {
72
+ foreach ( var type in types )
64
73
{
65
74
SetProperties ( type . GetProperties ( ) ) ;
66
75
SetMethods ( type . GetMethods ( ) ) ;
You can’t perform that action at this time.
0 commit comments