Skip to content

Commit

Permalink
Properly copy fields array before sorting in toObject, fixes #729
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Mar 27, 2017
1 parent 8de21e1 commit f755d36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit f755d36

Please sign in to comment.