Add a debug mode

This commit is contained in:
Thomas Weber committed 2021-03-25 20:41:45 -05:00
1 parent 1c41126a7b
commit 6a7822b429
2 files changed
+11

No files matched your search

+7
View File
@@ -409,6 +409,8 @@ class Runtime extends EventEmitter {
warpTimer: false
};
this.debug = false;
this._animationFrame = this._animationFrame.bind(this);
this._animationFrameId = null;
this._lastStepTime = Date.now();
@@ -2387,6 +2389,11 @@ class Runtime extends EventEmitter {
});
}
enableDebug () {
this.resetAllCaches();
this.debug = true;
}
/**
* Emit glows/glow clears for scripts after a single tick.
* Looks at `this.threads` and notices which have turned on/off new glows.
+4
View File
@@ -252,6 +252,10 @@ class VirtualMachine extends EventEmitter {
this.runtime.setCompilerOptions(compilerOptions);
}
enableDebug () {
this.runtime.enableDebug();
}
/**
* Stop all threads and running activities.
*/