Update VM getPlaygroundData function to remove circular dependency in blockContainer. It wasn't being used by the tests or the playground and it is not an issue with actual project serialization. Update test to stop passing in runtime to blocklyListen function.

This commit is contained in:
Karishma Chadha 2019-01-24 15:26:16 -05:00
parent e5723e299a
commit 0bf5d8ab90
2 changed files with 2 additions and 2 deletions

View file

@ -210,7 +210,7 @@ class VirtualMachine extends EventEmitter {
const threadData = this.runtime.threads.filter(thread => thread.target === instance.editingTarget);
// Remove the target key, since it's a circular reference.
const filteredThreadData = JSON.stringify(threadData, (key, value) => {
if (key === 'target') return;
if (key === 'target' || key === 'blockContainer') return;
return value;
}, 2);
this.emit('playgroundData', {

View file

@ -45,7 +45,7 @@ test('stack click activates the stack', t => {
blockContainer.blocklyListen({
blockId: blockId,
element: 'stackclick'
}, vm.runtime);
});
}
}