Repository navigation
Put simulator time, timers, randomness and environment behind pxsim.host - #11779
Draft
Eric Anderson (humanapp) wants to merge 1 commit into
Draft
Eric Anderson (humanapp) wants to merge 1 commit into
Eric Anderson (humanapp) wants to merge 1 commit into
Conversation
…xsim.host The runtime, the animation queue and the Math shims read time, timers and random numbers through pxsim.host instead of the globals, and the runtime reaches the parent window, the page URL and the frame id through a host environment that domhost.ts installs in the browser. The defaults are Date.now, performance.now, the global timers and Math.random, so the browser behaves as before. A virtual host whose clock moves only when asked, and whose random numbers come from a seed, is included for running programs deterministically; nothing uses it yet. The timer fields on Runtime are typed as host.TimerHandle instead of any.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of the stacked PRs replacing #11665.
The runtime, animation queue, and math shims now read time, timers and random numbers through
pxsim.host.domhost.tsis the host that installs in the browser. The browser behaves as before.virtualhost.tsadds a host whose clock moves only when stepped and whose random numbers come from a seed. Used by the headless runner, which comes later in the stack.