diff options
Diffstat (limited to 'js/src/Ice/UnknownSlicedValue.js')
-rw-r--r-- | js/src/Ice/UnknownSlicedValue.js | 111 |
1 files changed, 60 insertions, 51 deletions
diff --git a/js/src/Ice/UnknownSlicedValue.js b/js/src/Ice/UnknownSlicedValue.js index 754cb776f21..f653e715345 100644 --- a/js/src/Ice/UnknownSlicedValue.js +++ b/js/src/Ice/UnknownSlicedValue.js @@ -7,70 +7,79 @@ // // ********************************************************************** -var Ice = require("../Ice/ModuleRegistry").Ice; -Ice.__M.require(module, ["../Ice/Object", "../Ice/Class"]); +const Ice = require("../Ice/Object").Ice; -var SliceInfo = function() +class SliceInfo { - /** - * The Slice type ID for this slice. - **/ - this.typeId = ""; + constructor() + { + /** + * The Slice type ID for this slice. + **/ + this.typeId = ""; - /** - * The Slice compact type ID for this slice. - **/ - this.compactId = -1; + /** + * The Slice compact type ID for this slice. + **/ + this.compactId = -1; - /** - * The encoded bytes for this slice, including the leading size integer. - **/ - this.bytes = []; + /** + * The encoded bytes for this slice, including the leading size integer. + **/ + this.bytes = []; - /** - * The class instances referenced by this slice. - **/ - this.instances = []; + /** + * The class instances referenced by this slice. + **/ + this.instances = []; - /** - * Whether or not the slice contains optional members. - **/ - this.hasOptionalMembers = false; + /** + * Whether or not the slice contains optional members. + **/ + this.hasOptionalMembers = false; - /** - * Whether or not this is the last slice. - **/ - this.isLastSlice = false; -}; + /** + * Whether or not this is the last slice. + **/ + this.isLastSlice = false; + } +} Ice.SliceInfo = SliceInfo; -var SlicedData = function(slices) +class SlicedData { - this.slices = slices; -}; + constructor(slices) + { + this.slices = slices; + } +} Ice.SlicedData = SlicedData; -var UnknownSlicedValue = Ice.Class(Ice.Object, +class UnknownSlicedValue extends Ice.Object +{ + constructor(unknownTypeId) + { + super(); + this._unknownTypeId = unknownTypeId; + } + + getUnknownTypeId() + { + return this._unknownTypeId; + } + + __write(os) + { + os.startValue(this._slicedData); + os.endValue(); + } + + __read(is) { - __init__: function(unknownTypeId) - { - this._unknownTypeId = unknownTypeId; - }, - getUnknownTypeId: function() - { - return this._unknownTypeId; - }, - __write: function(os) - { - os.startValue(this._slicedData); - os.endValue(); - }, - __read: function(is) - { - is.startValue(); - this._slicedData = is.endValue(true); - } - }); + is.startValue(); + this._slicedData = is.endValue(true); + } +} Ice.UnknownSlicedValue = UnknownSlicedValue; module.exports.Ice = Ice; |