From 14a22953ddedf5881919a762bd68e072eacfec44 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 15 Dec 2015 18:05:20 +0100 Subject: [PATCH] Fix invalid returned value for dictionary types --- components/script/dom/bindings/codegen/CodegenRust.py | 4 ++-- components/script/dom/webidls/TestBinding.webidl | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 1e8033c7347..75de595694c 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -1016,8 +1016,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None, declType = CGGeneric(typeName) template = ("match %s::new(cx, ${val}) {\n" " Ok(dictionary) => dictionary,\n" - " Err(_) => return false,\n" - "}" % typeName) + " Err(_) => { %s },\n" + "}" % (typeName, exceptionCode)) return handleOptional(template, declType, handleDefaultNull("%s::empty(cx)" % typeName)) diff --git a/components/script/dom/webidls/TestBinding.webidl b/components/script/dom/webidls/TestBinding.webidl index a8573aa2ee5..e6495d90d66 100644 --- a/components/script/dom/webidls/TestBinding.webidl +++ b/components/script/dom/webidls/TestBinding.webidl @@ -28,6 +28,7 @@ dictionary TestDictionary { Blob interfaceValue; any anyValue; object objectValue; + TestDictionaryDefaults dict; }; dictionary TestDictionaryDefaults {