forked from scratchfoundation/scratch-vm
-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'TurboWarp:develop' into blockShape
- Loading branch information
Showing
7 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
test/integration/tw_compat_block_utility_stackframe_exposed.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const {test} = require('tap'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const VM = require('../../src/virtual-machine'); | ||
const Timer = require('../../src/util/timer'); | ||
|
||
test('compatibility stack frame is exposed on thread', t => { | ||
const vm = new VM(); | ||
vm.loadProject(fs.readFileSync(path.join(__dirname, '../fixtures/tw-glide.sb3'))).then(() => { | ||
vm.greenFlag(); | ||
vm.runtime._step(); | ||
t.ok(vm.runtime.threads[0].compatibilityStackFrame.timer instanceof Timer); | ||
t.end(); | ||
}); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const {test} = require('tap'); | ||
const VM = require('../../src/virtual-machine'); | ||
|
||
test('saveProjectSb3 is deterministic over time', t => { | ||
const vm = new VM(); | ||
Promise.all([ | ||
vm.saveProjectSb3('nodebuffer'), | ||
// Zip modification time is only accurate to the second | ||
new Promise(resolve => setTimeout(resolve, 1000)).then(() => vm.saveProjectSb3('nodebuffer')) | ||
]).then(([a, b]) => { | ||
t.same(a, b); | ||
t.end(); | ||
}); | ||
}); |