diff --git a/public/scripts/library/rdp/wip_rdp_abstract_sequence.js b/public/scripts/library/rdp/wip_rdp_abstract_sequence.js index e2a5c908..d572a0bd 100644 --- a/public/scripts/library/rdp/wip_rdp_abstract_sequence.js +++ b/public/scripts/library/rdp/wip_rdp_abstract_sequence.js @@ -6,16 +6,16 @@ import RdpEdit from './rdp_edit'; class WipRdpAbstractSequence extends Sequence { - constructor(attributes, ...other) { - if(!attributes.Klass) throw new TypeError('Must provide Klass attribute'); - if(!attributes.types) throw new TypeError('Must provide types attribute'); - var Klass = attributes.Klass; - var types = _.clone(attributes.types); - delete attributes.Klass; - delete attributes.types; + constructor(attributes, options={}) { + if(!options.Klass) throw new TypeError('Must provide Klass attribute'); + if(!options.types) throw new TypeError('Must provide types attribute'); + var Klass = options.Klass; + var types = _.clone(options.types); + delete options.Klass; + delete options.types; attributes.readOnly = true; - super(attributes, ...other); + super(attributes, options); this.Klass = Klass; this.types = types; diff --git a/public/scripts/library/rdp/wip_rdp_oligo_sequence.js b/public/scripts/library/rdp/wip_rdp_oligo_sequence.js index 341439d7..3306a5e4 100644 --- a/public/scripts/library/rdp/wip_rdp_oligo_sequence.js +++ b/public/scripts/library/rdp/wip_rdp_oligo_sequence.js @@ -9,13 +9,10 @@ var wip_rdp_oligo_sequence = 'wip_rdp_oligo_sequence'; class WipRdpOligoSequence extends WipRdpAbstractSequence { - constructor(attrs, ...args) { - if(attrs._type && attrs._type !== wip_rdp_oligo_sequence) { - throw new TypeError(`WipRdpPcrSequence expected _type of "${wip_rdp_oligo_sequence}" but was "${attrs._type}"`); - } - attrs.Klass = WipRdpOligoSequence; - attrs.types = RdpTypes.oligoTypes; - super(attrs, ...args); + constructor(attrs, options={}) { + options.Klass = WipRdpOligoSequence; + options.types = RdpTypes.oligoTypes; + super(attrs, options); this.set({_type: wip_rdp_oligo_sequence}, {silent: true}); } diff --git a/public/scripts/plugins/pcr/lib/wip_rdp_pcr_sequence.js b/public/scripts/plugins/pcr/lib/wip_rdp_pcr_sequence.js index 956f59c9..afc8ce19 100644 --- a/public/scripts/plugins/pcr/lib/wip_rdp_pcr_sequence.js +++ b/public/scripts/plugins/pcr/lib/wip_rdp_pcr_sequence.js @@ -8,10 +8,10 @@ var wip_rdp_pcr_product = 'wip_rdp_pcr_product'; class WipRdpPcrSequence extends WipRdpAbstractSequence { - constructor(attributes, ...other) { - attributes.Klass = WipRdpPcrSequence; - attributes.types = RdpTypes.pcrTypes; - super(attributes, ...other); + constructor(attributes, options={}) { + options.Klass = WipRdpPcrSequence; + options.types = RdpTypes.pcrTypes; + super(attributes, options); this.set({_type: wip_rdp_pcr_product}, {silent: true}); }