mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 22:42:27 -05:00
Create extensions list in serialize function
Removed runtime argument from serializeTarget call because it wasn't used
This commit is contained in:
parent
026dd96491
commit
befcbec393
1 changed files with 6 additions and 1 deletions
|
@ -466,12 +466,17 @@ const serializeTarget = function (target, extensions) {
|
|||
const serialize = function (runtime) {
|
||||
// Fetch targets
|
||||
const obj = Object.create(null);
|
||||
// Create extension set to hold extension ids found while serializing targets
|
||||
const extensions = new Set();
|
||||
const flattenedOriginalTargets = JSON.parse(JSON.stringify(
|
||||
runtime.targets.filter(target => target.isOriginal)));
|
||||
obj.targets = flattenedOriginalTargets.map(t => serializeTarget(t, runtime));
|
||||
obj.targets = flattenedOriginalTargets.map(t => serializeTarget(t, extensions));
|
||||
|
||||
// TODO Serialize monitors
|
||||
|
||||
// Assemble extension list
|
||||
obj.extensions = Array.from(extensions);
|
||||
|
||||
// Assemble metadata
|
||||
const meta = Object.create(null);
|
||||
meta.semver = '3.0.0';
|
||||
|
|
Loading…
Reference in a new issue