Prevent the runtime from spawning new stepping intervals

This commit is contained in:
Paul Kaplan 2018-11-28 08:34:22 -05:00
parent 05979e2e93
commit 4378603d36
2 changed files with 19 additions and 0 deletions
src/engine

View file

@ -2172,6 +2172,9 @@ class Runtime extends EventEmitter {
* Set up timers to repeatedly step in a browser.
*/
start () {
// Do not start if we are already running
if (this._steppingInterval) return;
let interval = Runtime.THREAD_STEP_INTERVAL;
if (this.compatibilityMode) {
interval = Runtime.THREAD_STEP_INTERVAL_COMPATIBILITY;