Open
Description
I'm trying to create NodeIterator object using the following code
var config = Configuration.Default.WithJs();
var context = BrowsingContext.New(config);
var document = await context.OpenAsync(req => req.Content("")).ConfigureAwait(false);
document.ExecuteScript("document.createNodeIterator(document.body, NodeFilter.SHOW_ELEMENT, null)");
Running it causes the exception Jint.Runtime.JavaScriptException: 'NodeFilter is not defined'
I see that FilterSettings
enum has [DomName("NodeFilter")]
attribute, and yet it is not visible in JS.
I tried to check where other DomName
attributes are resolved and that led me to the CreatorCache
, where enums and classes are treated in a different way, which might explain the problem. But being totally new to AngleSharp and AngleSharp.JS, maybe I miss something, e.g. some configuration switch, which forces NodeFilter to be registered in JS?
Versions:
AngleSharp & AngleSharp.JS: master
Jint: 4.2.1