Do not access group property from the object (#5257)

use the group reference
This commit is contained in:
Andrea Bogazzi 2018-09-22 20:19:41 +02:00 committed by GitHub
parent ffca4a8e56
commit 7dc02a8718
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -230,9 +230,10 @@
* @return {Object} object representation of an instance
*/
toObject: function(propertiesToInclude) {
var _includeDefaultValues = this.includeDefaultValues;
var objsToObject = this._objects.map(function(obj) {
var originalDefaults = obj.includeDefaultValues;
obj.includeDefaultValues = obj.group.includeDefaultValues;
obj.includeDefaultValues = _includeDefaultValues;
var _obj = obj.toObject(propertiesToInclude);
obj.includeDefaultValues = originalDefaults;
return _obj;
@ -253,9 +254,10 @@
objsToObject = sourcePath;
}
else {
var _includeDefaultValues = this.includeDefaultValues;
objsToObject = this._objects.map(function(obj) {
var originalDefaults = obj.includeDefaultValues;
obj.includeDefaultValues = obj.group.includeDefaultValues;
obj.includeDefaultValues = _includeDefaultValues;
var _obj = obj.toDatalessObject(propertiesToInclude);
obj.includeDefaultValues = originalDefaults;
return _obj;