From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../uniffi-bindgen-gecko-js/src/templates/js/Object.sys.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/Object.sys.mjs') diff --git a/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/Object.sys.mjs b/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/Object.sys.mjs index e03291089e..204bf752dd 100644 --- a/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/Object.sys.mjs +++ b/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/Object.sys.mjs @@ -51,7 +51,11 @@ export class {{ ffi_converter }} extends FfiConverter { } static lower(value) { - return value[uniffiObjectPtr]; + const ptr = value[uniffiObjectPtr]; + if (!(ptr instanceof UniFFIPointer)) { + throw new UniFFITypeError("Object is not a '{{ object.nm() }}' instance"); + } + return ptr; } static read(dataStream) { -- cgit v1.2.3