diff options
Diffstat (limited to 'components/script/dom/bindings/codegen')
-rw-r--r-- | components/script/dom/bindings/codegen/CodegenRust.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 92b05cb5780..934f3a7af82 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -80,7 +80,9 @@ builtinNames = { IDLType.Tags.uint16: 'u16', IDLType.Tags.uint32: 'u32', IDLType.Tags.uint64: 'u64', + IDLType.Tags.unrestricted_float: 'f32', IDLType.Tags.float: 'f32', + IDLType.Tags.unrestricted_double: 'f64', IDLType.Tags.double: 'f64' } @@ -89,7 +91,8 @@ numericTags = [ IDLType.Tags.int16, IDLType.Tags.uint16, IDLType.Tags.int32, IDLType.Tags.uint32, IDLType.Tags.int64, IDLType.Tags.uint64, - IDLType.Tags.float, IDLType.Tags.double + IDLType.Tags.unrestricted_float, IDLType.Tags.float, + IDLType.Tags.unrestricted_double, IDLType.Tags.double ] class CastableObjectUnwrapper(): @@ -962,7 +965,8 @@ def convertConstIDLValueToJSVal(value): return "DoubleVal(%s)" % (value.value) if tag == IDLType.Tags.bool: return "BoolVal(true)" if value.value else "BoolVal(false)" - if tag in [IDLType.Tags.float, IDLType.Tags.double]: + if tag in [IDLType.Tags.unrestricted_float, IDLType.Tags.float, + IDLType.Tags.unrestricted_double, IDLType.Tags.double]: return "DoubleVal(%s)" % (value.value) raise TypeError("Const value of unhandled type: " + value.type) @@ -2880,7 +2884,8 @@ def convertConstIDLValueToRust(value): IDLType.Tags.int16, IDLType.Tags.uint16, IDLType.Tags.int32, IDLType.Tags.uint32, IDLType.Tags.int64, IDLType.Tags.uint64, - IDLType.Tags.float, IDLType.Tags.double]: + IDLType.Tags.unrestricted_float, IDLType.Tags.float, + IDLType.Tags.unrestricted_double, IDLType.Tags.double]: return str(value.value) if tag == IDLType.Tags.bool: |