Skip to content
Permalink
Browse files

Use from_jsval for dictionaries.

  • Loading branch information
Ms2ger committed Feb 16, 2017
1 parent 3613e8f commit 8c8eb41cdf56feb3b03d3b47cf0a13024a2690d9
Showing with 2 additions and 2 deletions.
  1. +2 −2 components/script/dom/bindings/codegen/CodegenRust.py
@@ -1090,13 +1090,13 @@ def wrapObjectTemplate(templateBody, nullValue, isDefinitelyObject, type,
typeName = "%s::%s" % (CGDictionary.makeModuleName(type.inner),
CGDictionary.makeDictionaryName(type.inner))
declType = CGGeneric(typeName)
template = ("match %s::new(cx, ${val}) {\n"
template = ("match FromJSValConvertible::from_jsval(cx, ${val}, ()) {\n"
" Ok(ConversionResult::Success(dictionary)) => dictionary,\n"
" Ok(ConversionResult::Failure(error)) => {\n"
"%s\n"
" }\n"
" _ => { %s },\n"
"}" % (typeName, indent(failOrPropagate, 8), exceptionCode))
"}" % (indent(failOrPropagate, 8), exceptionCode))

return handleOptional(template, declType, handleDefaultNull("%s::empty(cx)" % typeName))

0 comments on commit 8c8eb41

Please sign in to comment.
You can’t perform that action at this time.