mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Update CodegenRust.py
This commit is contained in:
parent
87fad61851
commit
4bd814a078
1 changed files with 7 additions and 7 deletions
|
@ -1188,7 +1188,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
||||||
|
|
||||||
return handleOptional(template, declType, handleDefault(empty))
|
return handleOptional(template, declType, handleDefault(empty))
|
||||||
|
|
||||||
if type.isVoid():
|
if type.isUndefined():
|
||||||
# This one only happens for return values, and its easy: Just
|
# This one only happens for return values, and its easy: Just
|
||||||
# ignore the jsval.
|
# ignore the jsval.
|
||||||
return JSToNativeConversionInfo("", None, None)
|
return JSToNativeConversionInfo("", None, None)
|
||||||
|
@ -1439,7 +1439,7 @@ def getConversionConfigForType(type, isEnforceRange, isClamp, treatNullAs):
|
||||||
|
|
||||||
# Returns a CGThing containing the type of the return value.
|
# Returns a CGThing containing the type of the return value.
|
||||||
def getRetvalDeclarationForType(returnType, descriptorProvider):
|
def getRetvalDeclarationForType(returnType, descriptorProvider):
|
||||||
if returnType is None or returnType.isVoid():
|
if returnType is None or returnType.isUndefined():
|
||||||
# Nothing to declare
|
# Nothing to declare
|
||||||
return CGGeneric("()")
|
return CGGeneric("()")
|
||||||
if returnType.isPrimitive() and returnType.tag() in builtinNames:
|
if returnType.isPrimitive() and returnType.tag() in builtinNames:
|
||||||
|
@ -4338,7 +4338,7 @@ class CGMemberJITInfo(CGThing):
|
||||||
result += self.defineJitInfo(setterinfo, setter, "Setter",
|
result += self.defineJitInfo(setterinfo, setter, "Setter",
|
||||||
False, False, "AliasEverything",
|
False, False, "AliasEverything",
|
||||||
False, False, "0",
|
False, False, "0",
|
||||||
[BuiltinTypes[IDLBuiltinType.Types.void]],
|
[BuiltinTypes[IDLBuiltinType.Types.undefined]],
|
||||||
None)
|
None)
|
||||||
return result
|
return result
|
||||||
if self.member.isMethod():
|
if self.member.isMethod():
|
||||||
|
@ -4426,7 +4426,7 @@ class CGMemberJITInfo(CGThing):
|
||||||
if t.nullable():
|
if t.nullable():
|
||||||
# Sometimes it might return null, sometimes not
|
# Sometimes it might return null, sometimes not
|
||||||
return "JSVAL_TYPE_UNKNOWN"
|
return "JSVAL_TYPE_UNKNOWN"
|
||||||
if t.isVoid():
|
if t.isUndefined():
|
||||||
# No return, every time
|
# No return, every time
|
||||||
return "JSVAL_TYPE_UNDEFINED"
|
return "JSVAL_TYPE_UNDEFINED"
|
||||||
if t.isSequence():
|
if t.isSequence():
|
||||||
|
@ -4500,7 +4500,7 @@ class CGMemberJITInfo(CGThing):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getJSArgType(t):
|
def getJSArgType(t):
|
||||||
assert not t.isVoid()
|
assert not t.isUndefined()
|
||||||
if t.nullable():
|
if t.nullable():
|
||||||
# Sometimes it might return null, sometimes not
|
# Sometimes it might return null, sometimes not
|
||||||
return "JSJitInfo_ArgType::Null as i32 | %s" % CGMemberJITInfo.getJSArgType(t.inner)
|
return "JSJitInfo_ArgType::Null as i32 | %s" % CGMemberJITInfo.getJSArgType(t.inner)
|
||||||
|
@ -7336,7 +7336,7 @@ class CGNativeMember(ClassMethod):
|
||||||
# Mark our getters, which are attrs that
|
# Mark our getters, which are attrs that
|
||||||
# have a non-void return type, as const.
|
# have a non-void return type, as const.
|
||||||
const=(not member.isStatic() and member.isAttr()
|
const=(not member.isStatic() and member.isAttr()
|
||||||
and not signature[0].isVoid()),
|
and not signature[0].isUndefined()),
|
||||||
breakAfterSelf=breakAfterSelf,
|
breakAfterSelf=breakAfterSelf,
|
||||||
unsafe=unsafe,
|
unsafe=unsafe,
|
||||||
visibility=visibility)
|
visibility=visibility)
|
||||||
|
@ -7608,7 +7608,7 @@ class CallbackMember(CGNativeMember):
|
||||||
convertType = instantiateJSToNativeConversionTemplate(
|
convertType = instantiateJSToNativeConversionTemplate(
|
||||||
template, replacements, declType, "rvalDecl")
|
template, replacements, declType, "rvalDecl")
|
||||||
|
|
||||||
if self.retvalType is None or self.retvalType.isVoid():
|
if self.retvalType is None or self.retvalType.isUndefined():
|
||||||
retval = "()"
|
retval = "()"
|
||||||
elif self.retvalType.isAny():
|
elif self.retvalType.isAny():
|
||||||
retval = "rvalDecl.get()"
|
retval = "rvalDecl.get()"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue