mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +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),
|
typeName = "%s::%s" % (CGDictionary.makeModuleName(type.inner),
|
||||||
CGDictionary.makeDictionaryName(type.inner))
|
CGDictionary.makeDictionaryName(type.inner))
|
||||||
declType = CGGeneric(typeName)
|
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::Success(dictionary)) => dictionary,\n"
|
||||||
" Ok(ConversionResult::Failure(error)) => {\n"
|
" Ok(ConversionResult::Failure(error)) => {\n"
|
||||||
"%s\n"
|
"%s\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" _ => { %s },\n"
|
" _ => { %s },\n"
|
||||||
"}" % (typeName, indent(failOrPropagate, 8), exceptionCode))
|
"}" % (indent(failOrPropagate, 8), exceptionCode))
|
||||||
|
|
||||||
return handleOptional(template, declType, handleDefaultNull("%s::empty(cx)" % typeName))
|
return handleOptional(template, declType, handleDefaultNull("%s::empty(cx)" % typeName))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue