Skip to content

Commit

Permalink
Use from_jsval for dictionaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Feb 16, 2017
1 parent 3613e8f commit 8c8eb41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -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))

Expand Down

0 comments on commit 8c8eb41

Please sign in to comment.