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:
Karishma Chadha 2018-03-21 17:55:02 -04:00
parent ce6ef92eb5
commit 2c3e3472ed
2 changed files with 2 additions and 1 deletions

View file

@ -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);
}

View file

@ -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