mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Use from_jsval for dictionaries.
This commit is contained in:
parent
3613e8f231
commit
8c8eb41cdf
1 changed files with 2 additions and 2 deletions
|
@ -1090,13 +1090,13 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue