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

Use Int8array, int16array, uint16array, int32array & uint32array in WebIDL #31164

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -120,8 +120,13 @@ def wrapInNativeContainerType(type, inner):
IDLType.Tags.float: 'Finite<f32>',
IDLType.Tags.unrestricted_double: 'f64',
IDLType.Tags.double: 'Finite<f64>',
IDLType.Tags.int8array: 'Int8Array',
IDLType.Tags.uint8array: 'Uint8Array',
IDLType.Tags.int16array: 'Int16Array',
IDLType.Tags.uint16array: 'Uint16Array',
IDLType.Tags.int32array: 'Int32Array',
IDLType.Tags.uint32array: 'Uint32Array',
IDLType.Tags.float32array: 'Float32Array',
IDLType.Tags.uint8array: 'Uint8Array'
}

numericTags = [
Expand Down Expand Up @@ -6502,8 +6507,13 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
'js::rust::define_properties',
'js::rust::get_object_class',
'js::typedarray',
'js::typedarray::Float32Array',
'js::typedarray::Int8Array',
'js::typedarray::Uint8Array',
'js::typedarray::Int16Array',
'js::typedarray::Uint16Array',
'js::typedarray::Int32Array',
'js::typedarray::Uint32Array',
'js::typedarray::Float32Array',
'crate::dom',
'crate::dom::bindings',
'crate::dom::bindings::codegen::InterfaceObjectMap',
Expand Down
17 changes: 11 additions & 6 deletions third_party/WebIDL/WebIDL.py
Expand Up @@ -2401,8 +2401,13 @@ class IDLType(IDLObject):
"object",
# Funny stuff
"interface",
"float32array",
"int8array",
"uint8array",
"int16array",
"uint16array",
"int32array",
"uint32array",
"float32array",
"dictionary",
"enum",
"callback",
Expand Down Expand Up @@ -3635,13 +3640,13 @@ class IDLBuiltinType(IDLType):
Types.object: IDLType.Tags.object,
Types.ArrayBuffer: IDLType.Tags.interface,
Types.ArrayBufferView: IDLType.Tags.interface,
Types.Int8Array: IDLType.Tags.interface,
Types.Int8Array: IDLType.Tags.int8array,
Types.Uint8Array: IDLType.Tags.uint8array,
Types.Uint8ClampedArray: IDLType.Tags.interface,
Types.Int16Array: IDLType.Tags.interface,
Types.Uint16Array: IDLType.Tags.interface,
Types.Int32Array: IDLType.Tags.interface,
Types.Uint32Array: IDLType.Tags.interface,
Types.Int16Array: IDLType.Tags.int16array,
Types.Uint16Array: IDLType.Tags.uint16array,
Types.Int32Array: IDLType.Tags.int32array,
Types.Uint32Array: IDLType.Tags.uint32array,
Types.Float32Array: IDLType.Tags.float32array,
Types.Float64Array: IDLType.Tags.interface,
Types.ReadableStream: IDLType.Tags.interface,
Expand Down