From 9e3c08db40b8916968b9f30096c7be3f00ce9647 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:44:51 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../src/templates/js/UInt64.sys.mjs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/UInt64.sys.mjs (limited to 'toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/UInt64.sys.mjs') diff --git a/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/UInt64.sys.mjs b/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/UInt64.sys.mjs new file mode 100644 index 0000000000..a62a0b7e6c --- /dev/null +++ b/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/UInt64.sys.mjs @@ -0,0 +1,27 @@ +// Export the FFIConverter object to make external types work. +export class {{ ffi_converter }} extends FfiConverter { + static checkType(value) { + super.checkType(value); + if (!Number.isSafeInteger(value)) { + throw new UniFFITypeError(`${value} exceeds the safe integer bounds`); + } + if (value < 0) { + throw new UniFFITypeError(`${value} exceeds the U64 bounds`); + } + } + static computeSize() { + return 8; + } + static lift(value) { + return value; + } + static lower(value) { + return value; + } + static write(dataStream, value) { + dataStream.writeUint64(value) + } + static read(dataStream) { + return dataStream.readUint64() + } +} -- cgit v1.2.3