Permalink
Browse files

Properly copy fields array before sorting in toObject, fixes #729

  • Loading branch information...
dcodeIO committed Mar 27, 2017
1 parent 8de21e1 commit f755d36829b9f1effd7960fab3a86a141aeb9fea
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/converter.js
@@ -193,7 +193,7 @@ function genValuePartial_toObject(gen, field, fieldIndex, prop) {
*/
converter.toObject = function toObject(mtype) {
/* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */
var fields = mtype.fieldsArray.sort(util.compareFieldsById);
var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);
if (!fields.length)
return util.codegen()("return {}");
var gen = util.codegen("m", "o")

0 comments on commit f755d36

Please sign in to comment.