mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-10 06:52:00 -05:00
Add warning to 'fromJSON' function since it is now just a wrapper around loadProject. Change vm sb3_serialization test to use 'loadProject' function instead of 'fromJSON'.
This commit is contained in:
parent
ce6ef92eb5
commit
2c3e3472ed
2 changed files with 2 additions and 1 deletions
|
@ -269,6 +269,7 @@ class VirtualMachine extends EventEmitter {
|
|||
* @returns {Promise} Promise that resolves after the project has loaded
|
||||
*/
|
||||
fromJSON (json) {
|
||||
log.warning('fromJSON is now just a wrapper around loadProject, please use that function instead.');
|
||||
return this.loadProject(json);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ const demoSb3 = require('../fixtures/demo.json');
|
|||
|
||||
test('serialize', t => {
|
||||
const vm = new VirtualMachine();
|
||||
vm.fromJSON(JSON.stringify(demoSb3))
|
||||
vm.loadProject(JSON.stringify(demoSb3))
|
||||
.then(() => {
|
||||
const result = sb3.serialize(vm.runtime);
|
||||
// @todo Analyze
|
||||
|
|
Loading…
Reference in a new issue