mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Merge pull request #1899 from paulkaplan/less-cloning
Do not deep clone before serializing.
This commit is contained in:
commit
36fe6378db
1 changed files with 1 additions and 2 deletions
|
@ -14,7 +14,6 @@ const StageLayering = require('../engine/stage-layering');
|
||||||
const log = require('../util/log');
|
const log = require('../util/log');
|
||||||
const uid = require('../util/uid');
|
const uid = require('../util/uid');
|
||||||
const MathUtil = require('../util/math-util');
|
const MathUtil = require('../util/math-util');
|
||||||
const StringUtil = require('../util/string-util');
|
|
||||||
|
|
||||||
const {loadCostume} = require('../import/load-costume.js');
|
const {loadCostume} = require('../import/load-costume.js');
|
||||||
const {loadSound} = require('../import/load-sound.js');
|
const {loadSound} = require('../import/load-sound.js');
|
||||||
|
@ -521,7 +520,7 @@ const serialize = function (runtime, targetId) {
|
||||||
|
|
||||||
const layerOrdering = getSimplifiedLayerOrdering(originalTargetsToSerialize);
|
const layerOrdering = getSimplifiedLayerOrdering(originalTargetsToSerialize);
|
||||||
|
|
||||||
const flattenedOriginalTargets = JSON.parse(StringUtil.stringify(originalTargetsToSerialize));
|
const flattenedOriginalTargets = originalTargetsToSerialize.map(t => t.toJSON());
|
||||||
|
|
||||||
// If the renderer is attached, and we're serializing a whole project (not a sprite)
|
// If the renderer is attached, and we're serializing a whole project (not a sprite)
|
||||||
// add a temporary layerOrder property to each target.
|
// add a temporary layerOrder property to each target.
|
||||||
|
|
Loading…
Reference in a new issue