mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
auto merge of #1856 : Ms2ger/servo/argIsPointer, r=jdm
This commit is contained in:
commit
636ae6e762
1 changed files with 3 additions and 8 deletions
|
@ -907,11 +907,6 @@ for (uint32_t i = 0; i < length; ++i) {
|
||||||
failureCode)
|
failureCode)
|
||||||
return (template, declType, None, isOptional, None)
|
return (template, declType, None, isOptional, None)
|
||||||
|
|
||||||
# This is an interface that we implement as a concrete class
|
|
||||||
# or an XPCOM interface.
|
|
||||||
|
|
||||||
argIsPointer = type.nullable()
|
|
||||||
|
|
||||||
# Sequences and callbacks have to hold a strong ref to the thing being
|
# Sequences and callbacks have to hold a strong ref to the thing being
|
||||||
# passed down.
|
# passed down.
|
||||||
forceOwningType = descriptor.interface.isCallback() or isMember
|
forceOwningType = descriptor.interface.isCallback() or isMember
|
||||||
|
@ -930,14 +925,14 @@ for (uint32_t i = 0; i < length; ++i) {
|
||||||
"JSVAL_TO_OBJECT(${val})",
|
"JSVAL_TO_OBJECT(${val})",
|
||||||
"${declName}",
|
"${declName}",
|
||||||
failureCode,
|
failureCode,
|
||||||
isOptional or argIsPointer or type.nullable(),
|
isOptional or type.nullable(),
|
||||||
preUnwrapped=preSuccess, postUnwrapped=postSuccess))
|
preUnwrapped=preSuccess, postUnwrapped=postSuccess))
|
||||||
else:
|
else:
|
||||||
templateBody += str(FailureFatalCastableObjectUnwrapper(
|
templateBody += str(FailureFatalCastableObjectUnwrapper(
|
||||||
descriptor,
|
descriptor,
|
||||||
"JSVAL_TO_OBJECT(${val})",
|
"JSVAL_TO_OBJECT(${val})",
|
||||||
"${declName}",
|
"${declName}",
|
||||||
isOptional or argIsPointer or type.nullable()))
|
isOptional or type.nullable()))
|
||||||
else:
|
else:
|
||||||
templateBody += (
|
templateBody += (
|
||||||
"match unwrap_value::<" + typePtr + ">(&${val} as *JSVal, "
|
"match unwrap_value::<" + typePtr + ">(&${val} as *JSVal, "
|
||||||
|
@ -955,7 +950,7 @@ for (uint32_t i = 0; i < length; ++i) {
|
||||||
failureCode)
|
failureCode)
|
||||||
|
|
||||||
declType = CGGeneric(typePtr)
|
declType = CGGeneric(typePtr)
|
||||||
if argIsPointer or isOptional:
|
if type.nullable() or isOptional:
|
||||||
declType = CGWrapper(declType, pre="Option<", post=">")
|
declType = CGWrapper(declType, pre="Option<", post=">")
|
||||||
|
|
||||||
return (templateBody, declType, None, isOptional, "None" if isOptional else None)
|
return (templateBody, declType, None, isOptional, "None" if isOptional else None)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue