Make the wait block's logic and behavior more consistent with Scratch 2 ()

This commit is contained in:
Katie Broida 2018-12-04 10:35:42 -05:00 committed by GitHub
parent 536305af1b
commit 967cab8f20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 126 additions and 12 deletions
src/engine

View file

@ -304,6 +304,9 @@ class Runtime extends EventEmitter {
*/
this.currentStepTime = null;
// Set an intial value for this.currentMSecs
this.updateCurrentMSecs();
/**
* Whether any primitive has requested a redraw.
* Affects whether `Sequencer.stepThreads` will yield
@ -2262,6 +2265,15 @@ class Runtime extends EventEmitter {
disableProfiling () {
this.profiler = null;
}
/**
* Update a millisecond timestamp value that is saved on the Runtime.
* This value is helpful in certain instances for compatibility with Scratch 2,
* which sometimes uses a `currentMSecs` timestamp value in Interpreter.as
*/
updateCurrentMSecs () {
this.currentMSecs = Date.now();
}
}
/**