Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement WebIDL sequence arguments #9056

Merged
merged 4 commits into from Jan 12, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

codegen: Implement WebIDL sequence arguments

  • Loading branch information
emilio committed Jan 12, 2016
commit 92d7c4992413197d6899ef48d79ab1f92c2d6973
@@ -700,7 +700,16 @@ def wrapObjectTemplate(templateBody, nullValue, isDefinitelyObject, type,
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,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.