mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
codegen: Implement WebIDL sequence arguments
This commit is contained in:
parent
2f1eee599c
commit
92d7c49924
2 changed files with 11 additions and 2 deletions
|
@ -700,7 +700,16 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
raise TypeError("Can't handle array arguments yet")
|
||||
|
||||
if type.isSequence():
|
||||
raise TypeError("Can't handle sequence arguments yet")
|
||||
# Use the same type that for return values
|
||||
declType = getRetvalDeclarationForType(type, descriptorProvider)
|
||||
config = getConversionConfigForType(type, isEnforceRange, isClamp, treatNullAs)
|
||||
|
||||
templateBody = ("match FromJSValConvertible::from_jsval(cx, ${val}, %s) {\n"
|
||||
" Ok(value) => value,\n"
|
||||
" Err(()) => { %s },\n"
|
||||
"}" % (config, exceptionCode))
|
||||
|
||||
return handleOptional(templateBody, declType, handleDefaultNull("None"))
|
||||
|
||||
if type.isUnion():
|
||||
declType = CGGeneric(union_native_type(type))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue