mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -05:00
Clear runtime after validation success instead of before.
This commit is contained in:
parent
ab863096cd
commit
ce6ef92eb5
1 changed files with 3 additions and 3 deletions
|
@ -187,9 +187,6 @@ class VirtualMachine extends EventEmitter {
|
|||
input = JSON.stringify(input);
|
||||
}
|
||||
|
||||
// Clear the current runtime
|
||||
this.clear();
|
||||
|
||||
const validationPromise = new Promise((resolve, reject) => {
|
||||
validate(input, (error, res) => {
|
||||
if (error) {
|
||||
|
@ -282,6 +279,9 @@ class VirtualMachine extends EventEmitter {
|
|||
* @returns {Promise} Promise that resolves after the project has loaded
|
||||
*/
|
||||
deserializeProject (projectJSON, zip) {
|
||||
// Clear the current runtime
|
||||
this.clear();
|
||||
|
||||
const runtime = this.runtime;
|
||||
const deserializePromise = function () {
|
||||
const projectVersion = projectJSON.projectVersion;
|
||||
|
|
Loading…
Reference in a new issue