Skip to content

Commit b80e25f

Browse files
committed
Automatically add all events from core
1 parent 7ef2494 commit b80e25f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

AngleSharp.Scripting.JavaScript/EngineInstance.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
namespace AngleSharp.Scripting.JavaScript
22
{
33
using AngleSharp.Dom;
4-
using AngleSharp.Dom.Events;
54
using Jint;
65
using Jint.Runtime.Environments;
76
using System;
@@ -31,8 +30,8 @@ public EngineInstance(IWindow window, IDictionary<String, Object> assignments)
3130
_constructors = new DomConstructors(this);
3231
_constructors.Configure();
3332

34-
this.AddConstructor(_window, typeof(Event));
35-
this.AddConstructor(_window, typeof(CustomEvent));
33+
foreach (var type in typeof(INode).Assembly.ExportedTypes)
34+
this.AddConstructor(_window, type);
3635
}
3736

3837
public DomConstructors Constructors

0 commit comments

Comments
 (0)