Skip to content
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

Implement VM inside Happy DOM #454

Closed
capricorn86 opened this issue Apr 14, 2022 · 0 comments · Fixed by #458
Closed

Implement VM inside Happy DOM #454

capricorn86 opened this issue Apr 14, 2022 · 0 comments · Fixed by #458
Assignees
Labels
enhancement New feature or request

Comments

@capricorn86
Copy link
Owner

In order to solve general issues with native classes not being the same as what is used by the Javascript engine when inside a VM, Happy DOM should by default always be in a VM (e.g. [].constructor is not window.Array).

There has to be an alternative Window that is not a VM context for apps that want to run Happy DOM within the global scope.

Another problem is that timers are handled separately within a VM and globally. This got apparent when we where attempting to move to ES6 for some reason.

This change might be breaking.

@capricorn86 capricorn86 added the enhancement New feature or request label Apr 14, 2022
@capricorn86 capricorn86 self-assigned this Apr 14, 2022
capricorn86 added a commit that referenced this issue Apr 25, 2022
… inside a VM by contextifying Window when it is created. Adds a new class called GlobalWindow which lives in the global context and will not be contextified.
@capricorn86 capricorn86 linked a pull request Apr 26, 2022 that will close this issue
capricorn86 pushed a commit that referenced this issue Apr 26, 2022
…a new window called GlobalWindow, that will run in the global context. Changes target language from ES5 to ES2020 (module resolvement will still be CommonJS).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant