Merge pull request #1899 from paulkaplan/less-cloning

Do not deep clone before serializing.
This commit is contained in:
Karishma Chadha 2019-01-07 13:36:34 -05:00 committed by GitHub
commit 36fe6378db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,6 @@ const StageLayering = require('../engine/stage-layering');
const log = require('../util/log');
const uid = require('../util/uid');
const MathUtil = require('../util/math-util');
const StringUtil = require('../util/string-util');
const {loadCostume} = require('../import/load-costume.js');
const {loadSound} = require('../import/load-sound.js');
@ -521,7 +520,7 @@ const serialize = function (runtime, targetId) {
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)
// add a temporary layerOrder property to each target.