mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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))
|
||||
|
|
|
@ -25,7 +25,7 @@ use std::slice;
|
|||
use str::DOMString;
|
||||
|
||||
/// Behavior for stringification of `JSVal`s.
|
||||
#[derive(PartialEq)]
|
||||
#[derive(PartialEq, Clone)]
|
||||
pub enum StringificationBehavior {
|
||||
/// Convert `null` to the string `"null"`.
|
||||
Default,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue