New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor internals to support realm concept #907
Conversation
65b2d20
to
b41c24b
Compare
What's your feeling about how much closer it is to the specs with this PR? |
Current status is that it should now follow spec and constructs quite closely. I think that the constructs are now easier to understand and one can follow the spec with regards to references to realms (current realm etc). Tests are passing and now it's time for some polish and checking if AngleSharp custom host (Window object) can be implemented and what kind of hosting API it requires, close to finish I would say. |
Because this is already quite massive change I think it would be nice to get this into main before continuing the integration story via Host concepts. I've tested this API-wise against RavenDB and AngleSharp.JS, engine.Obsolete.cs helps to transition to realm and their code compiles as usual. |
Another nice outcome of making engine initialization lazier is that now one gets to run minimal scripts faster: var engine = new Engine();
return engine.Evaluate("return [].length + ''.length").AsNumber(); Before
After
The change is more visible when the script is parsed beforehand and only the Script instance is executed against new engine: Before
After
|
This PR will hopefully produce first version of Realm and Host concepts.
This will cater way for to additional features:
This PR will also unify and simplify initial engine by introducing separate
Intrinsics
object instead having it all inEngine
.