branch support-webpack updated (ac932eb -> ff7a55b)
This is an automated email from the git hooks/post-receive script. New change to branch support-webpack in repository oipf-stub. See https://gitlab.nuiton.org/codelutin/oipf-stub.git from ac932eb Changed the order of parameters in the Opera extension of oipfStub new ff7a55b Fix Collection and ScheduleRecording - Collection : fix constructor to take into account real Array signature and - ScheduleRecording : constructor (dont put a channel business object as internal representation of the channel business itself) and also fix toJSON to avoid mutation The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit ff7a55b450b9065bc3f230a1e0a015fa83ca2813 Author: Samuel Maisonneuve <maisonneuve@codelutin.com> Date: Thu Feb 1 10:16:35 2018 +0100 Fix Collection and ScheduleRecording - Collection : fix constructor to take into account real Array signature and - ScheduleRecording : constructor (dont put a channel business object as internal representation of the channel business itself) and also fix toJSON to avoid mutation Summary of changes: src/recording/ScheduledRecording.js | 8 ++++++-- src/shared/Collection.js | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) -- To stop receiving notification emails like this one, please contact SCM administrator <admin+scm@forge.codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch support-webpack in repository oipf-stub. See https://gitlab.nuiton.org/codelutin/oipf-stub.git commit ff7a55b450b9065bc3f230a1e0a015fa83ca2813 Author: Samuel Maisonneuve <maisonneuve@codelutin.com> Date: Thu Feb 1 10:16:35 2018 +0100 Fix Collection and ScheduleRecording - Collection : fix constructor to take into account real Array signature and - ScheduleRecording : constructor (dont put a channel business object as internal representation of the channel business itself) and also fix toJSON to avoid mutation --- src/recording/ScheduledRecording.js | 8 ++++++-- src/shared/Collection.js | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/recording/ScheduledRecording.js b/src/recording/ScheduledRecording.js index 792562c..878a48c 100644 --- a/src/recording/ScheduledRecording.js +++ b/src/recording/ScheduledRecording.js @@ -34,7 +34,11 @@ module.exports = function(ctx) { ctx.__internal__.init(this); this.__internal__.setValues(values); - values.channel && this.__internal__.setField("channel", new Channel(0, values.channel)); + + // If values.channel is a raw object we convert it to the corresponding business object + if (values.channel && values.channel.__internal__ == null) { + this.__internal__.setField("channel", new Channel(0, values.channel)); + } // Recording has been newly scheduled. this.RECORDING_SCHEDULED = 0; @@ -341,7 +345,7 @@ module.exports = function(ctx) { // to json is used because getter are not enumerable in ES6 classes toJSON() { - let result = this.__internal__.getValues(); + let result = Object.assign({}, this.__internal__.getValues()); if (this.channel) { result.channel = this.channel.toJSON(); } diff --git a/src/shared/Collection.js b/src/shared/Collection.js index c04c3f2..91c227b 100644 --- a/src/shared/Collection.js +++ b/src/shared/Collection.js @@ -21,7 +21,13 @@ module.exports = function() { constructor(values) { super(); - values && this.push.apply(this, values); + + // An Array constructor can receive either a list of element or the size of the array. + // (See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Obj...) + // Which means we need to filter out the case where the argument represents the length of the array... + if (!Number.isInteger(values)) { + this.push.apply(this, values); + } } item(index) { -- To stop receiving notification emails like this one, please contact SCM administrator <admin+scm@forge.codelutin.com>.
participants (1)
-
scm