use once_cell::sync::Lazy;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
use std::iter::FromIterator;

pub(crate) static BUILTIN_IDENTS: Lazy<BTreeSet<&'static str>> = Lazy::new(|| {
    BTreeSet::from_iter(vec![
        "str",
        "char",
        "bool",
        "JsValue",
        "u8",
        "i8",
        "u16",
        "i16",
        "u32",
        "i32",
        "u64",
        "i64",
        "usize",
        "isize",
        "f32",
        "f64",
        "Result",
        "String",
        "Vec",
        "Option",
        "Array",
        "ArrayBuffer",
        "Object",
        "Promise",
        "Function",
        "Clamped",
        "DataView",
        "Iterator",
        "AsyncIterator",
        "Int8Array",
        "Uint8Array",
        "Uint8ClampedArray",
        "Int16Array",
        "Uint16Array",
        "Int32Array",
        "Uint32Array",
        "Float32Array",
        "Float64Array",
    ])
});

// whitelist a few names that have known polyfills
pub(crate) static POLYFILL_INTERFACES: Lazy<BTreeSet<&'static str>> =
    Lazy::new(|| BTreeSet::from_iter(vec!["AudioContext", "OfflineAudioContext"]));

pub(crate) static IMMUTABLE_SLICE_WHITELIST: Lazy<BTreeSet<&'static str>> = Lazy::new(|| {
    BTreeSet::from_iter(vec![
        // ImageData
        "ImageData",
        // WebGlRenderingContext, WebGl2RenderingContext
        "uniform1fv",
        "uniform2fv",
        "uniform3fv",
        "uniform4fv",
        "uniform1iv",
        "uniform2iv",
        "uniform3iv",
        "uniform4iv",
        "uniformMatrix2fv",
        "uniformMatrix3fv",
        "uniformMatrix4fv",
        "uniformMatrix2x3fv",
        "uniformMatrix2x4fv",
        "uniformMatrix3x2fv",
        "uniformMatrix3x4fv",
        "uniformMatrix4x2fv",
        "uniformMatrix4x3fv",
        "vertexAttrib1fv",
        "vertexAttrib2fv",
        "vertexAttrib3fv",
        "vertexAttrib4fv",
        "bufferData",
        "bufferSubData",
        "texImage2D",
        "texSubImage2D",
        "compressedTexImage2D",
        // WebGl2RenderingContext
        "uniform1uiv",
        "uniform2uiv",
        "uniform3uiv",
        "uniform4uiv",
        "texImage3D",
        "texSubImage3D",
        "compressedTexImage3D",
        "clearBufferfv",
        "clearBufferiv",
        "clearBufferuiv",
        // WebSocket
        "send",
        // WebGPU
        "setBindGroup",
        "writeBuffer",
        "writeTexture",
        // AudioBuffer
        "copyToChannel",
        // FontFace
        "FontFace", // TODO: Add another type's functions here. Leave a comment header with the type name
        // FileSystemSyncAccessHandle and FileSystemWritableFileStream
        "write",
        // SubtleCrypto
        "encrypt",
        "decrypt",
        "digest",
        "sign",
        "unwrapKey",
        "verify",
        // TextDecoder
        "decode",
    ])
});

pub(crate) static FIXED_INTERFACES: Lazy<
    BTreeMap<&'static str, BTreeMap<&'static str, &'static str>>,
> = Lazy::new(|| {
    let image_bitmap = BTreeMap::from_iter([
        ("create_image_bitmap_with_html_image_element_and_i32_and_a_sy_and_a_sw_and_a_sh", "create_image_bitmap_with_html_image_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh"),
        ("create_image_bitmap_with_svg_image_element_and_i32_and_a_sy_and_a_sw_and_a_sh", "create_image_bitmap_with_svg_image_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh"),
        ("create_image_bitmap_with_html_canvas_element_and_i32_and_a_sy_and_a_sw_and_a_sh", "create_image_bitmap_with_html_canvas_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh"),
        ("create_image_bitmap_with_html_video_element_and_i32_and_a_sy_and_a_sw_and_a_sh", "create_image_bitmap_with_html_video_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh"),
        ("create_image_bitmap_with_image_bitmap_and_i32_and_a_sy_and_a_sw_and_a_sh", "create_image_bitmap_with_image_bitmap_and_a_sx_and_a_sy_and_a_sw_and_a_sh"),
        ("create_image_bitmap_with_offscreen_canvas_and_i32_and_a_sy_and_a_sw_and_a_sh", "create_image_bitmap_with_offscreen_canvas_and_a_sx_and_a_sy_and_a_sw_and_a_sh"),
        ("create_image_bitmap_with_video_frame_and_i32_and_a_sy_and_a_sw_and_a_sh", "create_image_bitmap_with_video_frame_and_a_sx_and_a_sy_and_a_sw_and_a_sh"),
        ("create_image_bitmap_with_blob_and_i32_and_a_sy_and_a_sw_and_a_sh", "create_image_bitmap_with_blob_and_a_sx_and_a_sy_and_a_sw_and_a_sh"),
        ("create_image_bitmap_with_image_data_and_i32_and_a_sy_and_a_sw_and_a_sh", "create_image_bitmap_with_image_data_and_a_sx_and_a_sy_and_a_sw_and_a_sh"),
        ("create_image_bitmap_with_html_image_element_and_i32_and_a_sy_and_a_sw_and_a_sh_and_a_options", "create_image_bitmap_with_html_image_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options"),
        ("create_image_bitmap_with_svg_image_element_and_i32_and_a_sy_and_a_sw_and_a_sh_and_a_options", "create_image_bitmap_with_svg_image_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options"),
        ("create_image_bitmap_with_html_canvas_element_and_i32_and_a_sy_and_a_sw_and_a_sh_and_a_options", "create_image_bitmap_with_html_canvas_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options"),
        ("create_image_bitmap_with_html_video_element_and_i32_and_a_sy_and_a_sw_and_a_sh_and_a_options", "create_image_bitmap_with_html_video_element_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options"),
        ("create_image_bitmap_with_image_bitmap_and_i32_and_a_sy_and_a_sw_and_a_sh_and_a_options", "create_image_bitmap_with_image_bitmap_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options"),
        ("create_image_bitmap_with_offscreen_canvas_and_i32_and_a_sy_and_a_sw_and_a_sh_and_a_options", "create_image_bitmap_with_offscreen_canvas_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options"),
        ("create_image_bitmap_with_video_frame_and_i32_and_a_sy_and_a_sw_and_a_sh_and_a_options", "create_image_bitmap_with_video_frame_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options"),
        ("create_image_bitmap_with_blob_and_i32_and_a_sy_and_a_sw_and_a_sh_and_a_options", "create_image_bitmap_with_blob_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options"),
        ("create_image_bitmap_with_image_data_and_i32_and_a_sy_and_a_sw_and_a_sh_and_a_options", "create_image_bitmap_with_image_data_and_a_sx_and_a_sy_and_a_sw_and_a_sh_and_a_options"),
    ]);

    let canvas_rendering_context = BTreeMap::from_iter([
        (
            "set_transform",
            "set_transform_with_default_dom_matrix_2d_init",
        ),
        (
            "set_transform_with_a_and_b_and_c_and_d_and_e_and_f",
            "set_transform",
        ),
    ]);

    BTreeMap::from_iter([
        ("Window", image_bitmap.clone()),
        ("WorkerGlobalScope", image_bitmap),
        ("CanvasRenderingContext2d", canvas_rendering_context.clone()),
        (
            "OffscreenCanvasRenderingContext2d",
            canvas_rendering_context,
        ),
        (
            "ReadableStreamByobReader",
            BTreeMap::from_iter([("read", "read_with_array_buffer_view")]),
        ),
        (
            "AudioBufferSourceNode",
            BTreeMap::from_iter([
                ("start_with_when_and_offset", "start_with_when_and_grain_offset"),
                ("start_with_when_and_offset_and_duration", "start_with_when_and_grain_offset_and_grain_duration"),
            ]),
        ),
        (
            "IdbFactory",
            BTreeMap::from_iter([("open_with_options", "open_with_idb_open_db_options")]),
        ),
        (
            "IdbDatabase",
            BTreeMap::from_iter([(
                "create_object_store_with_options",
                "create_object_store_with_optional_parameters",
            )]),
        ),
        (
            "IdbObjectStore",
            BTreeMap::from_iter([
                ("count_with_query", "count_with_key"),
                ("create_index_with_str_and_options", "create_index_with_str_and_optional_parameters"),
                ("create_index_with_str_sequence_and_options", "create_index_with_str_sequence_and_optional_parameters"),
                ("open_cursor_with_query", "open_cursor_with_range"),
                ("open_cursor_with_query_and_direction", "open_cursor_with_range_and_direction"),
                ("open_key_cursor_with_query", "open_key_cursor_with_range"),
                ("open_key_cursor_with_query_and_direction", "open_key_cursor_with_range_and_direction"),
                ("get_all_with_query", "get_all_with_key"),
                ("get_all_with_query_and_count", "get_all_with_key_and_limit"),
                ("get_all_keys_with_query", "get_all_keys_with_key"),
                ("get_all_keys_with_query_and_count", "get_all_keys_with_key_and_limit"),
            ]),
        ),
        (
            "IdbIndex",
            BTreeMap::from_iter([
                ("count_with_query", "count_with_key"),
                ("open_cursor_with_query", "open_cursor_with_range"),
                ("open_cursor_with_query_and_direction", "open_cursor_with_range_and_direction"),
                ("open_key_cursor_with_query", "open_key_cursor_with_range"),
                ("open_key_cursor_with_query_and_direction", "open_key_cursor_with_range_and_direction"),
                ("get_all_with_query", "get_all_with_key"),
                ("get_all_with_query_and_count", "get_all_with_key_and_limit"),
                ("get_all_keys_with_query", "get_all_keys_with_key"),
                ("get_all_keys_with_query_and_count", "get_all_keys_with_key_and_limit"),
            ]),
        ),
        (
            "Navigator",
            BTreeMap::from_iter([
                ("vibrate_with_u32", "vibrate_with_duration"),
                ("vibrate_with_u32_sequence", "vibrate_with_pattern"),
                ("send_beacon_with_opt_u8_slice", "send_beacon_with_opt_u8_array"),
                ("send_beacon_with_opt_u8_array", "send_beacon_with_opt_js_u8_array"),
            ]),
        ),
        (
            "AnalyserNode",
            BTreeMap::from_iter([
                ("get_byte_frequency_data_with_u8_slice", "get_byte_frequency_data"),
                ("get_byte_time_domain_data_with_u8_slice", "get_byte_time_domain_data"),
                ("get_float_frequency_data_with_f32_slice", "get_float_frequency_data"),
                ("get_float_time_domain_data_with_f32_slice", "get_float_time_domain_data"),
            ]),
        ),
        (
            "AudioBuffer",
            BTreeMap::from_iter([
                ("copy_from_channel_with_f32_slice", "copy_from_channel"),
                ("copy_from_channel_with_f32_slice_and_start_in_channel", "copy_from_channel_with_start_in_channel"),
                ("copy_to_channel_with_f32_slice", "copy_to_channel"),
                ("copy_to_channel_with_f32_slice_and_start_in_channel", "copy_to_channel_with_start_in_channel"),
            ]),
        ),
        (
            "AudioContext",
            BTreeMap::from_iter([
                ("create_periodic_wave_with_f32_slice_and_f32_slice", "create_periodic_wave"),
                ("create_periodic_wave_with_f32_slice_and_f32_slice_and_constraints", "create_periodic_wave_with_constraints"),
            ]),
        ),
        (
            "AudioParam",
            BTreeMap::from_iter([(
                "set_value_curve_at_time_with_f32_slice",
                "set_value_curve_at_time",
            )]),
        ),
        (
            "BaseAudioContext",
            BTreeMap::from_iter([
                ("create_periodic_wave_with_f32_slice_and_f32_slice", "create_periodic_wave"),
                ("create_periodic_wave_with_f32_slice_and_f32_slice_and_constraints", "create_periodic_wave_with_constraints"),
            ]),
        ),
        (
            "BiquadFilterNode",
            BTreeMap::from_iter([(
                "get_frequency_response_with_f32_slice_and_f32_slice_and_f32_slice",
                "get_frequency_response",
            )]),
        ),
        (
            "Crypto",
            BTreeMap::from_iter([
                ("get_random_values_with_u8_slice", "get_random_values_with_u8_array"),
                ("get_random_values_with_u8_array", "get_random_values_with_js_u8_array"),
            ]),
        ),
        (
            "DomMatrix",
            BTreeMap::from_iter([
                ("new_with_f32_slice", "new_with_array32"),
                ("new_with_f64_slice", "new_with_array64"),
            ]),
        ),
        (
            "FileSystemSyncAccessHandle",
            BTreeMap::from_iter([
                ("read_with_u8_slice", "read_with_u8_array"),
                ("read_with_u8_array", "read_with_js_u8_array"),
                ("read_with_u8_slice_and_options", "read_with_u8_array_and_options"),
                ("read_with_u8_array_and_options", "read_with_js_u8_array_and_options"),
                ("write_with_u8_slice", "write_with_u8_array"),
                ("write_with_u8_array", "write_with_js_u8_array"),
                ("write_with_u8_slice_and_options", "write_with_u8_array_and_options"),
                ("write_with_u8_array_and_options", "write_with_js_u8_array_and_options"),
            ]),
        ),
        (
            "FileSystemWritableFileStream",
            BTreeMap::from_iter([
                ("write_with_u8_slice", "write_with_u8_array"),
                ("write_with_u8_array", "write_with_js_u8_array"),
            ]),
        ),
        (
            "FontFace",
            BTreeMap::from_iter([
                ("new_with_u8_slice", "new_with_u8_array"),
                ("new_with_u8_array", "new_with_js_u8_array"),
                ("new_with_u8_slice_and_descriptors", "new_with_u8_array_and_descriptors"),
                ("new_with_u8_array_and_descriptors", "new_with_js_u8_array_and_descriptors"),
            ]),
        ),
        (
            "IdbFileHandle",
            BTreeMap::from_iter([
                ("append_with_u8_slice", "append_with_u8_array"),
                ("append_with_u8_array", "append_with_js_u8_array"),
                ("write_with_u8_slice", "write_with_u8_array"),
                ("write_with_u8_array", "write_with_js_u8_array"),
            ]),
        ),
        (
            "IirFilterNode",
            BTreeMap::from_iter([(
                "get_frequency_response_with_f32_slice_and_f32_slice_and_f32_slice",
                "get_frequency_response",
            )]),
        ),
        (
            "ImageData",
            BTreeMap::from_iter([
                ("new_with_u8_clamped_slice", "new_with_u8_clamped_array"),
                ("new_with_u8_clamped_array", "new_with_js_u8_clamped_array"),
                ("new_with_u8_clamped_slice_and_sh", "new_with_u8_clamped_array_and_sh"),
                ("new_with_u8_clamped_array_and_sh", "new_with_js_u8_clamped_array_and_sh"),
            ]),
        ),
        (
            "MediaKeys",
            BTreeMap::from_iter([
                ("set_server_certificate_with_u8_slice", "set_server_certificate_with_u8_array"),
                ("set_server_certificate_with_u8_array", "set_server_certificate_with_js_u8_array"),
            ]),
        ),
        (
            "MediaKeySession",
            BTreeMap::from_iter([
                ("generate_request_with_u8_slice", "generate_request_with_u8_array"),
                ("generate_request_with_u8_array", "generate_request_with_js_u8_array"),
                ("update_with_u8_slice", "update_with_u8_array"),
                ("update_with_u8_array", "update_with_js_u8_array"),
            ]),
        ),
        (
            "MediaKeyStatusMap",
            BTreeMap::from_iter([
                ("get_with_u8_slice", "get_with_u8_array"),
                ("get_with_u8_array", "get_with_js_u8_array"),
                ("has_with_u8_slice", "has_with_u8_array"),
                ("has_with_u8_array", "has_with_js_u8_array"),
            ]),
        ),
        (
            "OfflineAudioContext",
            BTreeMap::from_iter([
                ("create_periodic_wave_with_f32_slice_and_f32_slice", "create_periodic_wave"),
                ("create_periodic_wave_with_f32_slice_and_f32_slice_and_constraints", "create_periodic_wave_with_constraints"),
            ]),
        ),
        (
            "PresentationConnection",
            BTreeMap::from_iter([
                ("send_with_u8_slice", "send_with_u8_array"),
                ("send_with_u8_array", "send_with_js_u8_array"),
            ]),
        ),
        (
            "ReadableByteStreamController",
            BTreeMap::from_iter([
                ("enqueue_with_u8_slice", "enqueue_with_u8_array"),
                ("enqueue_with_u8_array", "enqueue_with_js_u8_array"),
            ]),
        ),
        (
            "ReadableStreamByobRequest",
            BTreeMap::from_iter([
                ("respond_with_new_view_with_u8_slice", "respond_with_new_view_with_u8_array"),
                ("respond_with_new_view_with_u8_array", "respond_with_new_view_with_js_u8_array"),
            ]),
        ),
        (
            "Response",
            BTreeMap::from_iter([
                ("new_with_opt_u8_slice", "new_with_opt_u8_array"),
                ("new_with_opt_u8_array", "new_with_opt_js_u8_array"),
                ("new_with_opt_u8_slice_and_init", "new_with_opt_u8_array_and_init"),
                ("new_with_opt_u8_array_and_init", "new_with_opt_js_u8_array_and_init"),
            ]),
        ),
        (
            "RtcDataChannel",
            BTreeMap::from_iter([
                ("send_with_u8_slice", "send_with_u8_array"),
                ("send_with_u8_array", "send_with_js_u8_array"),
            ]),
        ),
        (
            "SourceBuffer",
            BTreeMap::from_iter([
                ("append_buffer_with_u8_slice", "append_buffer_with_u8_array"),
                ("append_buffer_with_u8_array", "append_buffer_with_js_u8_array"),
                ("append_buffer_async_with_u8_slice", "append_buffer_async_with_u8_array"),
                ("append_buffer_async_with_u8_array", "append_buffer_async_with_js_u8_array"),
            ]),
        ),
        (
            "SubtleCrypto",
            BTreeMap::from_iter([
                ("decrypt_with_object_and_u8_slice", "decrypt_with_object_and_u8_array"),
                ("decrypt_with_object_and_u8_array", "decrypt_with_object_and_js_u8_array"),
                ("decrypt_with_str_and_u8_slice", "decrypt_with_str_and_u8_array"),
                ("decrypt_with_str_and_u8_array", "decrypt_with_str_and_js_u8_array"),
                ("digest_with_object_and_u8_slice", "digest_with_object_and_u8_array"),
                ("digest_with_object_and_u8_array", "digest_with_object_and_js_u8_array"),
                ("digest_with_str_and_u8_slice", "digest_with_str_and_u8_array"),
                ("digest_with_str_and_u8_array", "digest_with_str_and_js_u8_array"),
                ("encrypt_with_object_and_u8_slice", "encrypt_with_object_and_u8_array"),
                ("encrypt_with_object_and_u8_array", "encrypt_with_object_and_js_u8_array"),
                ("encrypt_with_str_and_u8_slice", "encrypt_with_str_and_u8_array"),
                ("encrypt_with_str_and_u8_array", "encrypt_with_str_and_js_u8_array"),
                ("sign_with_object_and_u8_slice", "sign_with_object_and_u8_array"),
                ("sign_with_object_and_u8_array", "sign_with_object_and_js_u8_array"),
                ("sign_with_str_and_u8_slice", "sign_with_str_and_u8_array"),
                ("sign_with_str_and_u8_array", "sign_with_str_and_js_u8_array"),
                ("unwrap_key_with_u8_slice_and_object_and_object", "unwrap_key_with_u8_array_and_object_and_object"),
                ("unwrap_key_with_u8_array_and_object_and_object", "unwrap_key_with_js_u8_array_and_object_and_object"),
                ("unwrap_key_with_u8_slice_and_str_and_object", "unwrap_key_with_u8_array_and_str_and_object"),
                ("unwrap_key_with_u8_array_and_str_and_object", "unwrap_key_with_js_u8_array_and_str_and_object"),
                ("unwrap_key_with_u8_slice_and_object_and_str", "unwrap_key_with_u8_array_and_object_and_str"),
                ("unwrap_key_with_u8_array_and_object_and_str", "unwrap_key_with_js_u8_array_and_object_and_str"),
                ("unwrap_key_with_u8_slice_and_str_and_str", "unwrap_key_with_u8_array_and_str_and_str"),
                ("unwrap_key_with_u8_array_and_str_and_str", "unwrap_key_with_js_u8_array_and_str_and_str"),
                ("unwrap_key_with_u8_slice_and_buffer_source", "unwrap_key_with_u8_array_and_buffer_source"),
                ("unwrap_key_with_u8_array_and_buffer_source", "unwrap_key_with_js_u8_array_and_buffer_source"),
                ("verify_with_object_and_u8_slice_and_buffer_source", "verify_with_object_and_u8_array_and_buffer_source"),
                ("verify_with_object_and_u8_array_and_buffer_source", "verify_with_object_and_js_u8_array_and_buffer_source"),
                ("verify_with_str_and_u8_slice_and_buffer_source", "verify_with_str_and_u8_array_and_buffer_source"),
                ("verify_with_str_and_u8_array_and_buffer_source", "verify_with_str_and_js_u8_array_and_buffer_source"),
                ("verify_with_object_and_buffer_source_and_u8_slice", "verify_with_object_and_buffer_source_and_u8_array"),
                ("verify_with_object_and_buffer_source_and_u8_array", "verify_with_object_and_buffer_source_and_js_u8_array"),
                ("verify_with_str_and_buffer_source_and_u8_slice", "verify_with_str_and_buffer_source_and_u8_array"),
                ("verify_with_str_and_buffer_source_and_u8_array", "verify_with_str_and_buffer_source_and_js_u8_array"),
                ("verify_with_object_and_u8_slice_and_u8_slice", "verify_with_object_and_u8_array_and_u8_array"),
                ("verify_with_object_and_u8_array_and_u8_array", "verify_with_object_and_js_u8_array_and_js_u8_array"),
                ("verify_with_str_and_u8_slice_and_u8_slice", "verify_with_str_and_u8_array_and_u8_array"),
                ("verify_with_str_and_u8_array_and_u8_array", "verify_with_str_and_js_u8_array_and_js_u8_array"),
            ]),
        ),
        (
            "TextDecoder",
            BTreeMap::from_iter([
                ("decode_with_u8_slice", "decode_with_u8_array"),
                ("decode_with_u8_array", "decode_with_js_u8_array"),
                ("decode_with_u8_slice_and_options", "decode_with_u8_array_and_options"),
                ("decode_with_u8_array_and_options", "decode_with_js_u8_array_and_options"),
            ]),
        ),
        (
            "VrMockController",
            BTreeMap::from_iter([
                ("new_pose_move_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice", "new_pose_move"),
            ]),
        ),
        (
            "VrMockDisplay",
            BTreeMap::from_iter([
                ("set_pose_with_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice_and_opt_f32_slice", "set_pose"),
            ]),
        ),
        (
            "WebGl2RenderingContext",
            BTreeMap::from_iter([
                ("buffer_data_with_u8_slice", "buffer_data_with_u8_array"),
                ("buffer_data_with_u8_array", "buffer_data_with_js_u8_array"),
                ("buffer_data_with_u8_slice_and_src_offset", "buffer_data_with_u8_array_and_src_offset"),
                ("buffer_data_with_u8_array_and_src_offset", "buffer_data_with_js_u8_array_and_src_offset"),
                ("buffer_data_with_u8_slice_and_src_offset_and_length", "buffer_data_with_u8_array_and_src_offset_and_length"),
                ("buffer_data_with_u8_array_and_src_offset_and_length", "buffer_data_with_js_u8_array_and_src_offset_and_length"),
                ("buffer_sub_data_with_i32_and_u8_slice", "buffer_sub_data_with_i32_and_u8_array"),
                ("buffer_sub_data_with_i32_and_u8_array", "buffer_sub_data_with_i32_and_js_u8_array"),
                ("buffer_sub_data_with_f64_and_u8_slice", "buffer_sub_data_with_f64_and_u8_array"),
                ("buffer_sub_data_with_f64_and_u8_array", "buffer_sub_data_with_f64_and_js_u8_array"),
                ("buffer_sub_data_with_i32_and_u8_slice_and_src_offset", "buffer_sub_data_with_i32_and_u8_array_and_src_offset"),
                ("buffer_sub_data_with_i32_and_u8_array_and_src_offset", "buffer_sub_data_with_i32_and_js_u8_array_and_src_offset"),
                ("buffer_sub_data_with_f64_and_u8_slice_and_src_offset", "buffer_sub_data_with_f64_and_u8_array_and_src_offset"),
                ("buffer_sub_data_with_f64_and_u8_array_and_src_offset", "buffer_sub_data_with_f64_and_js_u8_array_and_src_offset"),
                ("buffer_sub_data_with_i32_and_u8_slice_and_src_offset_and_length", "buffer_sub_data_with_i32_and_u8_array_and_src_offset_and_length"),
                ("buffer_sub_data_with_i32_and_u8_array_and_src_offset_and_length", "buffer_sub_data_with_i32_and_js_u8_array_and_src_offset_and_length"),
                ("buffer_sub_data_with_f64_and_u8_slice_and_src_offset_and_length", "buffer_sub_data_with_f64_and_u8_array_and_src_offset_and_length"),
                ("buffer_sub_data_with_f64_and_u8_array_and_src_offset_and_length", "buffer_sub_data_with_f64_and_js_u8_array_and_src_offset_and_length"),
                ("clear_bufferfv_with_f32_slice", "clear_bufferfv_with_f32_array"),
                ("clear_bufferfv_with_f32_array", "clear_bufferfv_with_js_f32_array"),
                ("clear_bufferfv_with_f32_slice_and_src_offset", "clear_bufferfv_with_f32_array_and_src_offset"),
                ("clear_bufferfv_with_f32_array_and_src_offset", "clear_bufferfv_with_js_f32_array_and_src_offset"),
                ("clear_bufferiv_with_i32_slice", "clear_bufferiv_with_i32_array"),
                ("clear_bufferiv_with_i32_array", "clear_bufferiv_with_js_i32_array"),
                ("clear_bufferiv_with_i32_slice_and_src_offset", "clear_bufferiv_with_i32_array_and_src_offset"),
                ("clear_bufferiv_with_i32_array_and_src_offset", "clear_bufferiv_with_js_i32_array_and_src_offset"),
                ("clear_bufferuiv_with_u32_slice", "clear_bufferuiv_with_u32_array"),
                ("clear_bufferuiv_with_u32_array", "clear_bufferuiv_with_js_u32_array"),
                ("clear_bufferuiv_with_u32_slice_and_src_offset", "clear_bufferuiv_with_u32_array_and_src_offset"),
                ("clear_bufferuiv_with_u32_array_and_src_offset", "clear_bufferuiv_with_js_u32_array_and_src_offset"),
                ("compressed_tex_image_2d_with_u8_slice", "compressed_tex_image_2d_with_u8_array"),
                ("compressed_tex_image_2d_with_u8_array", "compressed_tex_image_2d_with_js_u8_array"),
                ("compressed_tex_image_2d_with_u8_slice_and_u32", "compressed_tex_image_2d_with_u8_array_and_u32"),
                ("compressed_tex_image_2d_with_u8_array_and_u32", "compressed_tex_image_2d_with_js_u8_array_and_u32"),
                ("compressed_tex_image_2d_with_u8_slice_and_u32_and_src_length_override", "compressed_tex_image_2d_with_u8_array_and_u32_and_src_length_override"),
                ("compressed_tex_image_2d_with_u8_array_and_u32_and_src_length_override", "compressed_tex_image_2d_with_js_u8_array_and_u32_and_src_length_override"),
                ("compressed_tex_image_3d_with_u8_slice", "compressed_tex_image_3d_with_u8_array"),
                ("compressed_tex_image_3d_with_u8_array", "compressed_tex_image_3d_with_js_u8_array"),
                ("compressed_tex_image_3d_with_u8_slice_and_u32", "compressed_tex_image_3d_with_u8_array_and_u32"),
                ("compressed_tex_image_3d_with_u8_array_and_u32", "compressed_tex_image_3d_with_js_u8_array_and_u32"),
                ("compressed_tex_image_3d_with_u8_slice_and_u32_and_src_length_override", "compressed_tex_image_3d_with_u8_array_and_u32_and_src_length_override"),
                ("compressed_tex_image_3d_with_u8_array_and_u32_and_src_length_override", "compressed_tex_image_3d_with_js_u8_array_and_u32_and_src_length_override"),
                ("compressed_tex_sub_image_2d_with_u8_slice", "compressed_tex_sub_image_2d_with_u8_array"),
                ("compressed_tex_sub_image_2d_with_u8_array", "compressed_tex_sub_image_2d_with_js_u8_array"),
                ("compressed_tex_sub_image_2d_with_u8_slice_and_u32", "compressed_tex_sub_image_2d_with_u8_array_and_u32"),
                ("compressed_tex_sub_image_2d_with_u8_array_and_u32", "compressed_tex_sub_image_2d_with_js_u8_array_and_u32"),
                ("compressed_tex_sub_image_2d_with_u8_slice_and_u32_and_src_length_override", "compressed_tex_sub_image_2d_with_u8_array_and_u32_and_src_length_override"),
                ("compressed_tex_sub_image_2d_with_u8_array_and_u32_and_src_length_override", "compressed_tex_sub_image_2d_with_js_u8_array_and_u32_and_src_length_override"),
                ("compressed_tex_sub_image_3d_with_u8_slice", "compressed_tex_sub_image_3d_with_u8_array"),
                ("compressed_tex_sub_image_3d_with_u8_array", "compressed_tex_sub_image_3d_with_js_u8_array"),
                ("compressed_tex_sub_image_3d_with_u8_slice_and_u32", "compressed_tex_sub_image_3d_with_u8_array_and_u32"),
                ("compressed_tex_sub_image_3d_with_u8_array_and_u32", "compressed_tex_sub_image_3d_with_js_u8_array_and_u32"),
                ("compressed_tex_sub_image_3d_with_u8_slice_and_u32_and_src_length_override", "compressed_tex_sub_image_3d_with_u8_array_and_u32_and_src_length_override"),
                ("compressed_tex_sub_image_3d_with_u8_array_and_u32_and_src_length_override", "compressed_tex_sub_image_3d_with_js_u8_array_and_u32_and_src_length_override"),
                ("get_buffer_sub_data_with_i32_and_u8_slice", "get_buffer_sub_data_with_i32_and_u8_array"),
                ("get_buffer_sub_data_with_i32_and_u8_array", "get_buffer_sub_data_with_i32_and_js_u8_array"),
                ("get_buffer_sub_data_with_f64_and_u8_slice", "get_buffer_sub_data_with_f64_and_u8_array"),
                ("get_buffer_sub_data_with_f64_and_u8_array", "get_buffer_sub_data_with_f64_and_js_u8_array"),
                ("get_buffer_sub_data_with_i32_and_u8_slice_and_dst_offset", "get_buffer_sub_data_with_i32_and_u8_array_and_dst_offset"),
                ("get_buffer_sub_data_with_i32_and_u8_array_and_dst_offset", "get_buffer_sub_data_with_i32_and_js_u8_array_and_dst_offset"),
                ("get_buffer_sub_data_with_f64_and_u8_slice_and_dst_offset", "get_buffer_sub_data_with_f64_and_u8_array_and_dst_offset"),
                ("get_buffer_sub_data_with_f64_and_u8_array_and_dst_offset", "get_buffer_sub_data_with_f64_and_js_u8_array_and_dst_offset"),
                ("get_buffer_sub_data_with_i32_and_u8_slice_and_dst_offset_and_length", "get_buffer_sub_data_with_i32_and_u8_array_and_dst_offset_and_length"),
                ("get_buffer_sub_data_with_i32_and_u8_array_and_dst_offset_and_length", "get_buffer_sub_data_with_i32_and_js_u8_array_and_dst_offset_and_length"),
                ("get_buffer_sub_data_with_f64_and_u8_slice_and_dst_offset_and_length", "get_buffer_sub_data_with_f64_and_u8_array_and_dst_offset_and_length"),
                ("get_buffer_sub_data_with_f64_and_u8_array_and_dst_offset_and_length", "get_buffer_sub_data_with_f64_and_js_u8_array_and_dst_offset_and_length"),
                ("read_pixels_with_opt_u8_slice", "read_pixels_with_opt_u8_array"),
                ("read_pixels_with_opt_u8_array", "read_pixels_with_opt_js_u8_array"),
                ("read_pixels_with_u8_slice_and_dst_offset", "read_pixels_with_u8_array_and_dst_offset"),
                ("read_pixels_with_u8_array_and_dst_offset", "read_pixels_with_js_u8_array_and_dst_offset"),
                ("tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_slice", "tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array"),
                ("tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array", "tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_js_u8_array"),
                ("tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_u8_slice_and_src_offset", "tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_u8_array_and_src_offset"),
                ("tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_u8_array_and_src_offset", "tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_js_u8_array_and_src_offset"),
                ("tex_image_3d_with_opt_u8_slice", "tex_image_3d_with_opt_u8_array"),
                ("tex_image_3d_with_opt_u8_array", "tex_image_3d_with_opt_js_u8_array"),
                ("tex_image_3d_with_u8_slice_and_src_offset", "tex_image_3d_with_u8_array_and_src_offset"),
                ("tex_image_3d_with_u8_array_and_src_offset", "tex_image_3d_with_js_u8_array_and_src_offset"),
                ("tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_u8_slice", "tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_u8_array"),
                ("tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_u8_array", "tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_js_u8_array"),
                ("tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_u8_slice_and_src_offset", "tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_u8_array_and_src_offset"),
                ("tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_u8_array_and_src_offset", "tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_js_u8_array_and_src_offset"),
                ("tex_sub_image_3d_with_opt_u8_slice", "tex_sub_image_3d_with_opt_u8_array"),
                ("tex_sub_image_3d_with_opt_u8_array", "tex_sub_image_3d_with_opt_js_u8_array"),
                ("tex_sub_image_3d_with_opt_u8_slice_and_src_offset", "tex_sub_image_3d_with_opt_u8_array_and_src_offset"),
                ("tex_sub_image_3d_with_opt_u8_array_and_src_offset", "tex_sub_image_3d_with_opt_js_u8_array_and_src_offset"),
                ("uniform1fv_with_f32_slice", "uniform1fv_with_f32_array"),
                ("uniform1fv_with_f32_array", "uniform1fv_with_js_f32_array"),
                ("uniform1fv_with_f32_slice_and_src_offset", "uniform1fv_with_f32_array_and_src_offset"),
                ("uniform1fv_with_f32_array_and_src_offset", "uniform1fv_with_js_f32_array_and_src_offset"),
                ("uniform1fv_with_f32_slice_and_src_offset_and_src_length", "uniform1fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform1fv_with_f32_array_and_src_offset_and_src_length", "uniform1fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform1iv_with_i32_slice", "uniform1iv_with_i32_array"),
                ("uniform1iv_with_i32_array", "uniform1iv_with_js_i32_array"),
                ("uniform1iv_with_i32_slice_and_src_offset", "uniform1iv_with_i32_array_and_src_offset"),
                ("uniform1iv_with_i32_array_and_src_offset", "uniform1iv_with_js_i32_array_and_src_offset"),
                ("uniform1iv_with_i32_slice_and_src_offset_and_src_length", "uniform1iv_with_i32_array_and_src_offset_and_src_length"),
                ("uniform1iv_with_i32_array_and_src_offset_and_src_length", "uniform1iv_with_js_i32_array_and_src_offset_and_src_length"),
                ("uniform1uiv_with_u32_slice", "uniform1uiv_with_u32_array"),
                ("uniform1uiv_with_u32_array", "uniform1uiv_with_js_u32_array"),
                ("uniform1uiv_with_u32_slice_and_src_offset", "uniform1uiv_with_u32_array_and_src_offset"),
                ("uniform1uiv_with_u32_array_and_src_offset", "uniform1uiv_with_js_u32_array_and_src_offset"),
                ("uniform1uiv_with_u32_slice_and_src_offset_and_src_length", "uniform1uiv_with_u32_array_and_src_offset_and_src_length"),
                ("uniform1uiv_with_u32_array_and_src_offset_and_src_length", "uniform1uiv_with_js_u32_array_and_src_offset_and_src_length"),
                ("uniform2fv_with_f32_slice", "uniform2fv_with_f32_array"),
                ("uniform2fv_with_f32_array", "uniform2fv_with_js_f32_array"),
                ("uniform2fv_with_f32_slice_and_src_offset", "uniform2fv_with_f32_array_and_src_offset"),
                ("uniform2fv_with_f32_array_and_src_offset", "uniform2fv_with_js_f32_array_and_src_offset"),
                ("uniform2fv_with_f32_slice_and_src_offset_and_src_length", "uniform2fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform2fv_with_f32_array_and_src_offset_and_src_length", "uniform2fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform2iv_with_i32_slice", "uniform2iv_with_i32_array"),
                ("uniform2iv_with_i32_array", "uniform2iv_with_js_i32_array"),
                ("uniform2iv_with_i32_slice_and_src_offset", "uniform2iv_with_i32_array_and_src_offset"),
                ("uniform2iv_with_i32_array_and_src_offset", "uniform2iv_with_js_i32_array_and_src_offset"),
                ("uniform2iv_with_i32_slice_and_src_offset_and_src_length", "uniform2iv_with_i32_array_and_src_offset_and_src_length"),
                ("uniform2iv_with_i32_array_and_src_offset_and_src_length", "uniform2iv_with_js_i32_array_and_src_offset_and_src_length"),
                ("uniform2uiv_with_u32_slice", "uniform2uiv_with_u32_array"),
                ("uniform2uiv_with_u32_array", "uniform2uiv_with_js_u32_array"),
                ("uniform2uiv_with_u32_slice_and_src_offset", "uniform2uiv_with_u32_array_and_src_offset"),
                ("uniform2uiv_with_u32_array_and_src_offset", "uniform2uiv_with_js_u32_array_and_src_offset"),
                ("uniform2uiv_with_u32_slice_and_src_offset_and_src_length", "uniform2uiv_with_u32_array_and_src_offset_and_src_length"),
                ("uniform2uiv_with_u32_array_and_src_offset_and_src_length", "uniform2uiv_with_js_u32_array_and_src_offset_and_src_length"),
                ("uniform3fv_with_f32_slice", "uniform3fv_with_f32_array"),
                ("uniform3fv_with_f32_array", "uniform3fv_with_js_f32_array"),
                ("uniform3fv_with_f32_slice_and_src_offset", "uniform3fv_with_f32_array_and_src_offset"),
                ("uniform3fv_with_f32_array_and_src_offset", "uniform3fv_with_js_f32_array_and_src_offset"),
                ("uniform3fv_with_f32_slice_and_src_offset_and_src_length", "uniform3fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform3fv_with_f32_array_and_src_offset_and_src_length", "uniform3fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform3iv_with_i32_slice", "uniform3iv_with_i32_array"),
                ("uniform3iv_with_i32_array", "uniform3iv_with_js_i32_array"),
                ("uniform3iv_with_i32_slice_and_src_offset", "uniform3iv_with_i32_array_and_src_offset"),
                ("uniform3iv_with_i32_array_and_src_offset", "uniform3iv_with_js_i32_array_and_src_offset"),
                ("uniform3iv_with_i32_slice_and_src_offset_and_src_length", "uniform3iv_with_i32_array_and_src_offset_and_src_length"),
                ("uniform3iv_with_i32_array_and_src_offset_and_src_length", "uniform3iv_with_js_i32_array_and_src_offset_and_src_length"),
                ("uniform3uiv_with_u32_slice", "uniform3uiv_with_u32_array"),
                ("uniform3uiv_with_u32_array", "uniform3uiv_with_js_u32_array"),
                ("uniform3uiv_with_u32_slice_and_src_offset", "uniform3uiv_with_u32_array_and_src_offset"),
                ("uniform3uiv_with_u32_array_and_src_offset", "uniform3uiv_with_js_u32_array_and_src_offset"),
                ("uniform3uiv_with_u32_slice_and_src_offset_and_src_length", "uniform3uiv_with_u32_array_and_src_offset_and_src_length"),
                ("uniform3uiv_with_u32_array_and_src_offset_and_src_length", "uniform3uiv_with_js_u32_array_and_src_offset_and_src_length"),
                ("uniform4fv_with_f32_slice", "uniform4fv_with_f32_array"),
                ("uniform4fv_with_f32_array", "uniform4fv_with_js_f32_array"),
                ("uniform4fv_with_f32_slice_and_src_offset", "uniform4fv_with_f32_array_and_src_offset"),
                ("uniform4fv_with_f32_array_and_src_offset", "uniform4fv_with_js_f32_array_and_src_offset"),
                ("uniform4fv_with_f32_slice_and_src_offset_and_src_length", "uniform4fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform4fv_with_f32_array_and_src_offset_and_src_length", "uniform4fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform4iv_with_i32_slice", "uniform4iv_with_i32_array"),
                ("uniform4iv_with_i32_array", "uniform4iv_with_js_i32_array"),
                ("uniform4iv_with_i32_slice_and_src_offset", "uniform4iv_with_i32_array_and_src_offset"),
                ("uniform4iv_with_i32_array_and_src_offset", "uniform4iv_with_js_i32_array_and_src_offset"),
                ("uniform4iv_with_i32_slice_and_src_offset_and_src_length", "uniform4iv_with_i32_array_and_src_offset_and_src_length"),
                ("uniform4iv_with_i32_array_and_src_offset_and_src_length", "uniform4iv_with_js_i32_array_and_src_offset_and_src_length"),
                ("uniform4uiv_with_u32_slice", "uniform4uiv_with_u32_array"),
                ("uniform4uiv_with_u32_array", "uniform4uiv_with_js_u32_array"),
                ("uniform4uiv_with_u32_slice_and_src_offset", "uniform4uiv_with_u32_array_and_src_offset"),
                ("uniform4uiv_with_u32_array_and_src_offset", "uniform4uiv_with_js_u32_array_and_src_offset"),
                ("uniform4uiv_with_u32_slice_and_src_offset_and_src_length", "uniform4uiv_with_u32_array_and_src_offset_and_src_length"),
                ("uniform4uiv_with_u32_array_and_src_offset_and_src_length", "uniform4uiv_with_js_u32_array_and_src_offset_and_src_length"),
                ("uniform_matrix2fv_with_f32_slice", "uniform_matrix2fv_with_f32_array"),
                ("uniform_matrix2fv_with_f32_array", "uniform_matrix2fv_with_js_f32_array"),
                ("uniform_matrix2fv_with_f32_slice_and_src_offset", "uniform_matrix2fv_with_f32_array_and_src_offset"),
                ("uniform_matrix2fv_with_f32_array_and_src_offset", "uniform_matrix2fv_with_js_f32_array_and_src_offset"),
                ("uniform_matrix2fv_with_f32_slice_and_src_offset_and_src_length", "uniform_matrix2fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix2fv_with_f32_array_and_src_offset_and_src_length", "uniform_matrix2fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix2x3fv_with_f32_slice", "uniform_matrix2x3fv_with_f32_array"),
                ("uniform_matrix2x3fv_with_f32_array", "uniform_matrix2x3fv_with_js_f32_array"),
                ("uniform_matrix2x3fv_with_f32_slice_and_src_offset", "uniform_matrix2x3fv_with_f32_array_and_src_offset"),
                ("uniform_matrix2x3fv_with_f32_array_and_src_offset", "uniform_matrix2x3fv_with_js_f32_array_and_src_offset"),
                ("uniform_matrix2x3fv_with_f32_slice_and_src_offset_and_src_length", "uniform_matrix2x3fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix2x3fv_with_f32_array_and_src_offset_and_src_length", "uniform_matrix2x3fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix2x4fv_with_f32_slice", "uniform_matrix2x4fv_with_f32_array"),
                ("uniform_matrix2x4fv_with_f32_array", "uniform_matrix2x4fv_with_js_f32_array"),
                ("uniform_matrix2x4fv_with_f32_slice_and_src_offset", "uniform_matrix2x4fv_with_f32_array_and_src_offset"),
                ("uniform_matrix2x4fv_with_f32_array_and_src_offset", "uniform_matrix2x4fv_with_js_f32_array_and_src_offset"),
                ("uniform_matrix2x4fv_with_f32_slice_and_src_offset_and_src_length", "uniform_matrix2x4fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix2x4fv_with_f32_array_and_src_offset_and_src_length", "uniform_matrix2x4fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix3fv_with_f32_slice", "uniform_matrix3fv_with_f32_array"),
                ("uniform_matrix3fv_with_f32_array", "uniform_matrix3fv_with_js_f32_array"),
                ("uniform_matrix3fv_with_f32_slice_and_src_offset", "uniform_matrix3fv_with_f32_array_and_src_offset"),
                ("uniform_matrix3fv_with_f32_array_and_src_offset", "uniform_matrix3fv_with_js_f32_array_and_src_offset"),
                ("uniform_matrix3fv_with_f32_slice_and_src_offset_and_src_length", "uniform_matrix3fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix3fv_with_f32_array_and_src_offset_and_src_length", "uniform_matrix3fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix3x2fv_with_f32_slice", "uniform_matrix3x2fv_with_f32_array"),
                ("uniform_matrix3x2fv_with_f32_array", "uniform_matrix3x2fv_with_js_f32_array"),
                ("uniform_matrix3x2fv_with_f32_slice_and_src_offset", "uniform_matrix3x2fv_with_f32_array_and_src_offset"),
                ("uniform_matrix3x2fv_with_f32_array_and_src_offset", "uniform_matrix3x2fv_with_js_f32_array_and_src_offset"),
                ("uniform_matrix3x2fv_with_f32_slice_and_src_offset_and_src_length", "uniform_matrix3x2fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix3x2fv_with_f32_array_and_src_offset_and_src_length", "uniform_matrix3x2fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix3x4fv_with_f32_slice", "uniform_matrix3x4fv_with_f32_array"),
                ("uniform_matrix3x4fv_with_f32_array", "uniform_matrix3x4fv_with_js_f32_array"),
                ("uniform_matrix3x4fv_with_f32_slice_and_src_offset", "uniform_matrix3x4fv_with_f32_array_and_src_offset"),
                ("uniform_matrix3x4fv_with_f32_array_and_src_offset", "uniform_matrix3x4fv_with_js_f32_array_and_src_offset"),
                ("uniform_matrix3x4fv_with_f32_slice_and_src_offset_and_src_length", "uniform_matrix3x4fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix3x4fv_with_f32_array_and_src_offset_and_src_length", "uniform_matrix3x4fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix4fv_with_f32_slice", "uniform_matrix4fv_with_f32_array"),
                ("uniform_matrix4fv_with_f32_array", "uniform_matrix4fv_with_js_f32_array"),
                ("uniform_matrix4fv_with_f32_slice_and_src_offset", "uniform_matrix4fv_with_f32_array_and_src_offset"),
                ("uniform_matrix4fv_with_f32_array_and_src_offset", "uniform_matrix4fv_with_js_f32_array_and_src_offset"),
                ("uniform_matrix4fv_with_f32_slice_and_src_offset_and_src_length", "uniform_matrix4fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix4fv_with_f32_array_and_src_offset_and_src_length", "uniform_matrix4fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix4x2fv_with_f32_slice", "uniform_matrix4x2fv_with_f32_array"),
                ("uniform_matrix4x2fv_with_f32_array", "uniform_matrix4x2fv_with_js_f32_array"),
                ("uniform_matrix4x2fv_with_f32_slice_and_src_offset", "uniform_matrix4x2fv_with_f32_array_and_src_offset"),
                ("uniform_matrix4x2fv_with_f32_array_and_src_offset", "uniform_matrix4x2fv_with_js_f32_array_and_src_offset"),
                ("uniform_matrix4x2fv_with_f32_slice_and_src_offset_and_src_length", "uniform_matrix4x2fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix4x2fv_with_f32_array_and_src_offset_and_src_length", "uniform_matrix4x2fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix4x3fv_with_f32_slice", "uniform_matrix4x3fv_with_f32_array"),
                ("uniform_matrix4x3fv_with_f32_array", "uniform_matrix4x3fv_with_js_f32_array"),
                ("uniform_matrix4x3fv_with_f32_slice_and_src_offset", "uniform_matrix4x3fv_with_f32_array_and_src_offset"),
                ("uniform_matrix4x3fv_with_f32_array_and_src_offset", "uniform_matrix4x3fv_with_js_f32_array_and_src_offset"),
                ("uniform_matrix4x3fv_with_f32_slice_and_src_offset_and_src_length", "uniform_matrix4x3fv_with_f32_array_and_src_offset_and_src_length"),
                ("uniform_matrix4x3fv_with_f32_array_and_src_offset_and_src_length", "uniform_matrix4x3fv_with_js_f32_array_and_src_offset_and_src_length"),
                ("vertex_attrib_i4iv_with_i32_slice", "vertex_attrib_i4iv_with_i32_array"),
                ("vertex_attrib_i4iv_with_i32_array", "vertex_attrib_i4iv_with_js_i32_array"),
                ("vertex_attrib_i4uiv_with_u32_slice", "vertex_attrib_i4uiv_with_u32_array"),
                ("vertex_attrib_i4uiv_with_u32_array", "vertex_attrib_i4uiv_with_js_u32_array"),
                ("vertex_attrib1fv_with_f32_slice", "vertex_attrib1fv_with_f32_array"),
                ("vertex_attrib1fv_with_f32_array", "vertex_attrib1fv_with_js_f32_array"),
                ("vertex_attrib2fv_with_f32_slice", "vertex_attrib2fv_with_f32_array"),
                ("vertex_attrib2fv_with_f32_array", "vertex_attrib2fv_with_js_f32_array"),
                ("vertex_attrib3fv_with_f32_slice", "vertex_attrib3fv_with_f32_array"),
                ("vertex_attrib3fv_with_f32_array", "vertex_attrib3fv_with_js_f32_array"),
                ("vertex_attrib4fv_with_f32_slice", "vertex_attrib4fv_with_f32_array"),
                ("vertex_attrib4fv_with_f32_array", "vertex_attrib4fv_with_js_f32_array"),
            ]),
        ),
        (
            "WebglMultiDraw",
            BTreeMap::from_iter([
                ("multi_draw_arrays_instanced_webgl_with_i32_slice_and_i32_slice_and_i32_slice", "multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_array_and_i32_array"),
                ("multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_array_and_i32_array", "multi_draw_arrays_instanced_webgl_with_js_i32_array_and_js_i32_array_and_js_i32_array"),
                ("multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_slice_and_i32_slice", "multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_array"),
                ("multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_array", "multi_draw_arrays_instanced_webgl_with_i32_sequence_and_js_i32_array_and_js_i32_array"),
                ("multi_draw_arrays_instanced_webgl_with_i32_slice_and_i32_sequence_and_i32_slice", "multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_array"),
                ("multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_array", "multi_draw_arrays_instanced_webgl_with_js_i32_array_and_i32_sequence_and_js_i32_array"),
                ("multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_sequence_and_i32_slice", "multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_sequence_and_i32_array"),
                ("multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_sequence_and_i32_array", "multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_sequence_and_js_i32_array"),
                ("multi_draw_arrays_instanced_webgl_with_i32_slice_and_i32_slice_and_i32_sequence", "multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_array_and_i32_sequence"),
                ("multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_array_and_i32_sequence", "multi_draw_arrays_instanced_webgl_with_js_i32_array_and_js_i32_array_and_i32_sequence"),
                ("multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_slice_and_i32_sequence", "multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_sequence"),
                ("multi_draw_arrays_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_sequence", "multi_draw_arrays_instanced_webgl_with_i32_sequence_and_js_i32_array_and_i32_sequence"),
                ("multi_draw_arrays_instanced_webgl_with_i32_slice_and_i32_sequence_and_i32_sequence", "multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_sequence"),
                ("multi_draw_arrays_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_sequence", "multi_draw_arrays_instanced_webgl_with_js_i32_array_and_i32_sequence_and_i32_sequence"),
                ("multi_draw_arrays_webgl_with_i32_slice_and_i32_slice", "multi_draw_arrays_webgl_with_i32_array_and_i32_array"),
                ("multi_draw_arrays_webgl_with_i32_array_and_i32_array", "multi_draw_arrays_webgl_with_js_i32_array_and_js_i32_array"),
                ("multi_draw_arrays_webgl_with_i32_sequence_and_i32_slice", "multi_draw_arrays_webgl_with_i32_sequence_and_i32_array"),
                ("multi_draw_arrays_webgl_with_i32_sequence_and_i32_array", "multi_draw_arrays_webgl_with_i32_sequence_and_js_i32_array"),
                ("multi_draw_arrays_webgl_with_i32_slice_and_i32_sequence", "multi_draw_arrays_webgl_with_i32_array_and_i32_sequence"),
                ("multi_draw_arrays_webgl_with_i32_array_and_i32_sequence", "multi_draw_arrays_webgl_with_js_i32_array_and_i32_sequence"),
                ("multi_draw_elements_instanced_webgl_with_i32_slice_and_i32_slice_and_i32_slice", "multi_draw_elements_instanced_webgl_with_i32_array_and_i32_array_and_i32_array"),
                ("multi_draw_elements_instanced_webgl_with_i32_array_and_i32_array_and_i32_array", "multi_draw_elements_instanced_webgl_with_js_i32_array_and_js_i32_array_and_js_i32_array"),
                ("multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_slice_and_i32_slice", "multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_array"),
                ("multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_array", "multi_draw_elements_instanced_webgl_with_i32_sequence_and_js_i32_array_and_js_i32_array"),
                ("multi_draw_elements_instanced_webgl_with_i32_slice_and_i32_sequence_and_i32_slice", "multi_draw_elements_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_array"),
                ("multi_draw_elements_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_array", "multi_draw_elements_instanced_webgl_with_js_i32_array_and_i32_sequence_and_js_i32_array"),
                ("multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_sequence_and_i32_slice", "multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_sequence_and_i32_array"),
                ("multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_sequence_and_i32_array", "multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_sequence_and_js_i32_array"),
                ("multi_draw_elements_instanced_webgl_with_i32_slice_and_i32_slice_and_i32_sequence", "multi_draw_elements_instanced_webgl_with_i32_array_and_i32_array_and_i32_sequence"),
                ("multi_draw_elements_instanced_webgl_with_i32_array_and_i32_array_and_i32_sequence", "multi_draw_elements_instanced_webgl_with_js_i32_array_and_js_i32_array_and_i32_sequence"),
                ("multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_slice_and_i32_sequence", "multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_sequence"),
                ("multi_draw_elements_instanced_webgl_with_i32_sequence_and_i32_array_and_i32_sequence", "multi_draw_elements_instanced_webgl_with_i32_sequence_and_js_i32_array_and_i32_sequence"),
                ("multi_draw_elements_instanced_webgl_with_i32_slice_and_i32_sequence_and_i32_sequence", "multi_draw_elements_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_sequence"),
                ("multi_draw_elements_instanced_webgl_with_i32_array_and_i32_sequence_and_i32_sequence", "multi_draw_elements_instanced_webgl_with_js_i32_array_and_i32_sequence_and_i32_sequence"),
                ("multi_draw_elements_webgl_with_i32_slice_and_i32_slice", "multi_draw_elements_webgl_with_i32_array_and_i32_array"),
                ("multi_draw_elements_webgl_with_i32_array_and_i32_array", "multi_draw_elements_webgl_with_js_i32_array_and_js_i32_array"),
                ("multi_draw_elements_webgl_with_i32_sequence_and_i32_slice", "multi_draw_elements_webgl_with_i32_sequence_and_i32_array"),
                ("multi_draw_elements_webgl_with_i32_sequence_and_i32_array", "multi_draw_elements_webgl_with_i32_sequence_and_js_i32_array"),
                ("multi_draw_elements_webgl_with_i32_slice_and_i32_sequence", "multi_draw_elements_webgl_with_i32_array_and_i32_sequence"),
                ("multi_draw_elements_webgl_with_i32_array_and_i32_sequence", "multi_draw_elements_webgl_with_js_i32_array_and_i32_sequence"),
            ]),
        ),
        (
            "WebGlRenderingContext",
            BTreeMap::from_iter([
                ("buffer_data_with_u8_slice", "buffer_data_with_u8_array"),
                ("buffer_data_with_u8_array", "buffer_data_with_js_u8_array"),
                ("buffer_sub_data_with_i32_and_u8_slice", "buffer_sub_data_with_i32_and_u8_array"),
                ("buffer_sub_data_with_i32_and_u8_array", "buffer_sub_data_with_i32_and_js_u8_array"),
                ("buffer_sub_data_with_f64_and_u8_slice", "buffer_sub_data_with_f64_and_u8_array"),
                ("buffer_sub_data_with_f64_and_u8_array", "buffer_sub_data_with_f64_and_js_u8_array"),
                ("compressed_tex_image_2d_with_u8_slice", "compressed_tex_image_2d_with_u8_array"),
                ("compressed_tex_image_2d_with_u8_array", "compressed_tex_image_2d_with_js_u8_array"),
                ("compressed_tex_sub_image_2d_with_u8_slice", "compressed_tex_sub_image_2d_with_u8_array"),
                ("compressed_tex_sub_image_2d_with_u8_array", "compressed_tex_sub_image_2d_with_js_u8_array"),
                ("read_pixels_with_opt_u8_slice", "read_pixels_with_opt_u8_array"),
                ("read_pixels_with_opt_u8_array", "read_pixels_with_opt_js_u8_array"),
                ("tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_slice", "tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array"),
                ("tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_u8_array", "tex_image_2d_with_i32_and_i32_and_i32_and_format_and_type_and_opt_js_u8_array"),
                ("tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_u8_slice", "tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_u8_array"),
                ("tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_u8_array", "tex_sub_image_2d_with_i32_and_i32_and_u32_and_type_and_opt_js_u8_array"),
                ("uniform1fv_with_f32_slice", "uniform1fv_with_f32_array"),
                ("uniform1fv_with_f32_array", "uniform1fv_with_js_f32_array"),
                ("uniform1iv_with_i32_slice", "uniform1iv_with_i32_array"),
                ("uniform1iv_with_i32_array", "uniform1iv_with_js_i32_array"),
                ("uniform2fv_with_f32_slice", "uniform2fv_with_f32_array"),
                ("uniform2fv_with_f32_array", "uniform2fv_with_js_f32_array"),
                ("uniform2iv_with_i32_slice", "uniform2iv_with_i32_array"),
                ("uniform2iv_with_i32_array", "uniform2iv_with_js_i32_array"),
                ("uniform3fv_with_f32_slice", "uniform3fv_with_f32_array"),
                ("uniform3fv_with_f32_array", "uniform3fv_with_js_f32_array"),
                ("uniform3iv_with_i32_slice", "uniform3iv_with_i32_array"),
                ("uniform3iv_with_i32_array", "uniform3iv_with_js_i32_array"),
                ("uniform4fv_with_f32_slice", "uniform4fv_with_f32_array"),
                ("uniform4fv_with_f32_array", "uniform4fv_with_js_f32_array"),
                ("uniform4iv_with_i32_slice", "uniform4iv_with_i32_array"),
                ("uniform4iv_with_i32_array", "uniform4iv_with_js_i32_array"),
                ("uniform_matrix2fv_with_f32_slice", "uniform_matrix2fv_with_f32_array"),
                ("uniform_matrix2fv_with_f32_array", "uniform_matrix2fv_with_js_f32_array"),
                ("uniform_matrix3fv_with_f32_slice", "uniform_matrix3fv_with_f32_array"),
                ("uniform_matrix3fv_with_f32_array", "uniform_matrix3fv_with_js_f32_array"),
                ("uniform_matrix4fv_with_f32_slice", "uniform_matrix4fv_with_f32_array"),
                ("uniform_matrix4fv_with_f32_array", "uniform_matrix4fv_with_js_f32_array"),
                ("vertex_attrib1fv_with_f32_slice", "vertex_attrib1fv_with_f32_array"),
                ("vertex_attrib1fv_with_f32_array", "vertex_attrib1fv_with_js_f32_array"),
                ("vertex_attrib2fv_with_f32_slice", "vertex_attrib2fv_with_f32_array"),
                ("vertex_attrib2fv_with_f32_array", "vertex_attrib2fv_with_js_f32_array"),
                ("vertex_attrib3fv_with_f32_slice", "vertex_attrib3fv_with_f32_array"),
                ("vertex_attrib3fv_with_f32_array", "vertex_attrib3fv_with_js_f32_array"),
                ("vertex_attrib4fv_with_f32_slice", "vertex_attrib4fv_with_f32_array"),
                ("vertex_attrib4fv_with_f32_array", "vertex_attrib4fv_with_js_f32_array"),
            ]),
        ),
        (
            "WebSocket",
            BTreeMap::from_iter([
                ("send_with_u8_slice", "send_with_u8_array"),
                ("send_with_u8_array", "send_with_js_u8_array"),
            ]),
        ),
        (
            "XmlHttpRequest",
            BTreeMap::from_iter([
                ("send_with_opt_u8_slice", "send_with_opt_u8_array"),
                ("send_with_opt_u8_array", "send_with_opt_js_u8_array"),
            ]),
        ),
    ])
});

pub(crate) static BREAKING_GETTER_THROWS: Lazy<BTreeMap<&'static str, Vec<&'static str>>> =
    Lazy::new(|| {
        BTreeMap::from_iter([
            ("Blob", vec!["size"]),
            ("CanvasRenderingContext2D", vec!["lineJoin"]),
            ("ExtendableMessageEvent", vec!["data"]),
            ("File", vec!["lastModified"]),
            ("FileSystemEntry", vec!["name", "fullPath"]),
            ("HTMLElement", vec!["innerText"]),
            ("MessageEvent", vec!["data"]),
            ("OffscreenCanvasRenderingContext2D", vec!["lineJoin"]),
            ("URL", vec!["origin"]),
        ])
    });

pub(crate) static BREAKING_SETTER_THROWS: Lazy<BTreeMap<&'static str, Vec<&'static str>>> =
    Lazy::new(|| {
        BTreeMap::from_iter([
            (
                "AnalyserNode",
                vec![
                    "fftSize",
                    "minDecibels",
                    "maxDecibels",
                    "smoothingTimeConstant",
                ],
            ),
            ("Animation", vec!["currentTime"]),
            ("Attr", vec!["value"]),
            (
                "AudioNode",
                vec!["channelCount", "channelCountMode", "channelInterpretation"],
            ),
            ("CSSConditionRule", vec!["conditionText"]),
            ("CSSFontFeatureValuesRule", vec!["fontFamily", "valueText"]),
            ("CSSStyleDeclaration", vec!["cssText"]),
            ("CanvasRenderingContext2D", vec!["filter", "font"]),
            ("CharacterData", vec!["data"]),
            ("ConvolverNode", vec!["buffer"]),
            ("DOMTokenList", vec!["value"]),
            ("Document", vec!["title", "body"]),
            ("Element", vec!["innerHTML", "outerHTML", "slot"]),
            (
                "FontFace",
                vec![
                    "family",
                    "style",
                    "weight",
                    "stretch",
                    "unicodeRange",
                    "variant",
                    "featureSettings",
                    "variationSettings",
                    "display",
                ],
            ),
            (
                "HTMLAnchorElement",
                vec![
                    "target",
                    "download",
                    "ping",
                    "rel",
                    "referrerPolicy",
                    "hreflang",
                    "type",
                    "coords",
                    "charset",
                    "name",
                    "rev",
                    "shape",
                    "href",
                ],
            ),
            (
                "HTMLAreaElement",
                vec![
                    "alt",
                    "coords",
                    "shape",
                    "target",
                    "download",
                    "ping",
                    "rel",
                    "referrerPolicy",
                    "noHref",
                    "href",
                ],
            ),
            ("HTMLBRElement", vec!["clear"]),
            ("HTMLBaseElement", vec!["href", "target"]),
            (
                "HTMLBodyElement",
                vec!["text", "link", "vLink", "aLink", "bgColor", "background"],
            ),
            (
                "HTMLButtonElement",
                vec![
                    "autofocus",
                    "disabled",
                    "formAction",
                    "formEnctype",
                    "formMethod",
                    "formNoValidate",
                    "formTarget",
                    "name",
                    "type",
                    "value",
                ],
            ),
            ("HTMLCanvasElement", vec!["width", "height"]),
            ("HTMLDListElement", vec!["compact"]),
            ("HTMLDataElement", vec!["value"]),
            ("HTMLDetailsElement", vec!["open"]),
            ("HTMLDialogElement", vec!["open"]),
            ("HTMLDirectoryElement", vec!["compact"]),
            ("HTMLDivElement", vec!["align"]),
            ("HTMLDocument", vec!["domain", "designMode"]),
            (
                "HTMLElement",
                vec![
                    "dir",
                    "hidden",
                    "tabIndex",
                    "accessKey",
                    "draggable",
                    "contentEditable",
                    "spellcheck",
                ],
            ),
            (
                "HTMLEmbedElement",
                vec!["src", "type", "width", "height", "align", "name"],
            ),
            ("HTMLFieldSetElement", vec!["disabled", "name"]),
            ("HTMLFontElement", vec!["color", "face", "size"]),
            (
                "HTMLFormElement",
                vec![
                    "acceptCharset",
                    "action",
                    "autocomplete",
                    "enctype",
                    "encoding",
                    "method",
                    "name",
                    "noValidate",
                    "target",
                ],
            ),
            (
                "HTMLFrameElement",
                vec![
                    "name",
                    "scrolling",
                    "src",
                    "frameBorder",
                    "longDesc",
                    "noResize",
                    "marginHeight",
                    "marginWidth",
                ],
            ),
            ("HTMLFrameSetElement", vec!["cols", "rows"]),
            (
                "HTMLHRElement",
                vec!["align", "color", "noShade", "size", "width"],
            ),
            ("HTMLHeadingElement", vec!["align"]),
            ("HTMLHtmlElement", vec!["version"]),
            (
                "HTMLIFrameElement",
                vec![
                    "src",
                    "srcdoc",
                    "name",
                    "allowFullscreen",
                    "allowPaymentRequest",
                    "width",
                    "height",
                    "referrerPolicy",
                    "align",
                    "scrolling",
                    "frameBorder",
                    "longDesc",
                    "marginHeight",
                    "marginWidth",
                ],
            ),
            (
                "HTMLImageElement",
                vec![
                    "alt",
                    "src",
                    "srcset",
                    "crossOrigin",
                    "useMap",
                    "referrerPolicy",
                    "isMap",
                    "width",
                    "height",
                    "decoding",
                    "name",
                    "align",
                    "hspace",
                    "vspace",
                    "longDesc",
                    "border",
                    "sizes",
                ],
            ),
            (
                "HTMLInputElement",
                vec![
                    "accept",
                    "alt",
                    "autocomplete",
                    "autofocus",
                    "defaultChecked",
                    "disabled",
                    "formAction",
                    "formEnctype",
                    "formMethod",
                    "formNoValidate",
                    "formTarget",
                    "height",
                    "inputMode",
                    "max",
                    "maxLength",
                    "min",
                    "minLength",
                    "multiple",
                    "name",
                    "pattern",
                    "placeholder",
                    "readOnly",
                    "required",
                    "size",
                    "src",
                    "step",
                    "type",
                    "defaultValue",
                    "value",
                    "valueAsNumber",
                    "width",
                    "align",
                    "useMap",
                    "webkitdirectory",
                ],
            ),
            ("HTMLLIElement", vec!["value", "type"]),
            ("HTMLLegendElement", vec!["align"]),
            (
                "HTMLLinkElement",
                vec![
                    "href",
                    "crossOrigin",
                    "rel",
                    "media",
                    "hreflang",
                    "type",
                    "referrerPolicy",
                    "charset",
                    "rev",
                    "target",
                    "integrity",
                    "as",
                ],
            ),
            ("HTMLMapElement", vec!["name"]),
            (
                "HTMLMediaElement",
                vec![
                    "src",
                    "crossOrigin",
                    "preload",
                    "currentTime",
                    "defaultPlaybackRate",
                    "playbackRate",
                    "autoplay",
                    "loop",
                    "controls",
                    "volume",
                    "defaultMuted",
                ],
            ),
            ("HTMLMenuElement", vec!["type", "label", "compact"]),
            (
                "HTMLMenuItemElement",
                vec![
                    "type",
                    "label",
                    "icon",
                    "disabled",
                    "radiogroup",
                    "defaultChecked",
                ],
            ),
            (
                "HTMLMetaElement",
                vec!["name", "httpEquiv", "content", "scheme"],
            ),
            (
                "HTMLMeterElement",
                vec!["value", "min", "max", "low", "high", "optimum"],
            ),
            ("HTMLModElement", vec!["cite", "dateTime"]),
            (
                "HTMLOListElement",
                vec!["reversed", "start", "type", "compact"],
            ),
            (
                "HTMLObjectElement",
                vec![
                    "data",
                    "type",
                    "typeMustMatch",
                    "name",
                    "useMap",
                    "width",
                    "height",
                    "align",
                    "archive",
                    "code",
                    "declare",
                    "hspace",
                    "standby",
                    "vspace",
                    "codeBase",
                    "codeType",
                    "border",
                ],
            ),
            ("HTMLOptGroupElement", vec!["disabled", "label"]),
            (
                "HTMLOptionElement",
                vec!["disabled", "label", "defaultSelected", "value", "text"],
            ),
            ("HTMLOptionsCollection", vec!["length"]),
            ("HTMLOutputElement", vec!["name", "defaultValue", "value"]),
            ("HTMLParagraphElement", vec!["align"]),
            (
                "HTMLParamElement",
                vec!["name", "value", "type", "valueType"],
            ),
            ("HTMLPreElement", vec!["width"]),
            ("HTMLProgressElement", vec!["value", "max"]),
            ("HTMLQuoteElement", vec!["cite"]),
            (
                "HTMLScriptElement",
                vec![
                    "src",
                    "type",
                    "noModule",
                    "charset",
                    "async",
                    "defer",
                    "crossOrigin",
                    "event",
                    "htmlFor",
                    "integrity",
                ],
            ),
            (
                "HTMLSelectElement",
                vec![
                    "autofocus",
                    "autocomplete",
                    "disabled",
                    "multiple",
                    "name",
                    "required",
                    "size",
                    "length",
                    "selectedIndex",
                ],
            ),
            ("HTMLSlotElement", vec!["name"]),
            (
                "HTMLSourceElement",
                vec!["src", "type", "srcset", "sizes", "media"],
            ),
            ("HTMLStyleElement", vec!["media", "type"]),
            ("HTMLTableCaptionElement", vec!["align"]),
            (
                "HTMLTableCellElement",
                vec![
                    "colSpan", "rowSpan", "headers", "align", "axis", "height", "width", "ch",
                    "chOff", "noWrap", "vAlign", "bgColor",
                ],
            ),
            (
                "HTMLTableColElement",
                vec!["span", "align", "ch", "chOff", "vAlign", "width"],
            ),
            (
                "HTMLTableElement",
                vec![
                    "caption",
                    "tHead",
                    "tFoot",
                    "align",
                    "border",
                    "frame",
                    "rules",
                    "summary",
                    "width",
                    "bgColor",
                    "cellPadding",
                    "cellSpacing",
                ],
            ),
            (
                "HTMLTableRowElement",
                vec!["align", "ch", "chOff", "vAlign", "bgColor"],
            ),
            (
                "HTMLTableSectionElement",
                vec!["align", "ch", "chOff", "vAlign"],
            ),
            (
                "HTMLTextAreaElement",
                vec![
                    "autocomplete",
                    "autofocus",
                    "cols",
                    "disabled",
                    "maxLength",
                    "minLength",
                    "name",
                    "placeholder",
                    "readOnly",
                    "required",
                    "rows",
                    "wrap",
                    "value",
                ],
            ),
            ("HTMLTimeElement", vec!["dateTime"]),
            (
                "HTMLTrackElement",
                vec!["kind", "src", "srclang", "label", "default"],
            ),
            ("HTMLUListElement", vec!["compact", "type"]),
            ("HTMLVideoElement", vec!["width", "height", "poster"]),
            ("IDBIndex", vec!["name"]),
            ("IDBObjectStore", vec!["name"]),
            ("MediaSource", vec!["duration"]),
            ("Node", vec!["nodeValue", "textContent"]),
            ("OffscreenCanvas", vec!["width", "height"]),
            ("OffscreenCanvasRenderingContext2D", vec!["filter", "font"]),
            ("OscillatorNode", vec!["type"]),
            (
                "SVGAElement",
                vec![
                    "download",
                    "ping",
                    "rel",
                    "referrerPolicy",
                    "hreflang",
                    "type",
                ],
            ),
            (
                "SVGAngle",
                vec!["value", "valueInSpecifiedUnits", "valueAsString"],
            ),
            ("SVGAnimatedEnumeration", vec!["baseVal"]),
            ("SVGElement", vec!["tabIndex"]),
            ("SVGLength", vec!["valueInSpecifiedUnits", "valueAsString"]),
            ("SVGMatrix", vec!["a", "b", "c", "d", "e", "f"]),
            ("SVGNumber", vec!["value"]),
            (
                "SVGPathSegArcAbs",
                vec!["x", "y", "r1", "r2", "angle", "largeArcFlag", "sweepFlag"],
            ),
            (
                "SVGPathSegArcRel",
                vec!["x", "y", "r1", "r2", "angle", "largeArcFlag", "sweepFlag"],
            ),
            (
                "SVGPathSegCurvetoCubicAbs",
                vec!["x", "y", "x1", "y1", "x2", "y2"],
            ),
            (
                "SVGPathSegCurvetoCubicRel",
                vec!["x", "y", "x1", "y1", "x2", "y2"],
            ),
            (
                "SVGPathSegCurvetoCubicSmoothAbs",
                vec!["x", "y", "x2", "y2"],
            ),
            (
                "SVGPathSegCurvetoCubicSmoothRel",
                vec!["x", "y", "x2", "y2"],
            ),
            ("SVGPathSegCurvetoQuadraticAbs", vec!["x", "y", "x1", "y1"]),
            ("SVGPathSegCurvetoQuadraticRel", vec!["x", "y", "x1", "y1"]),
            ("SVGPathSegCurvetoQuadraticSmoothAbs", vec!["x", "y"]),
            ("SVGPathSegCurvetoQuadraticSmoothRel", vec!["x", "y"]),
            ("SVGPathSegLinetoAbs", vec!["x", "y"]),
            ("SVGPathSegLinetoHorizontalAbs", vec!["x"]),
            ("SVGPathSegLinetoHorizontalRel", vec!["x"]),
            ("SVGPathSegLinetoRel", vec!["x", "y"]),
            ("SVGPathSegLinetoVerticalAbs", vec!["y"]),
            ("SVGPathSegLinetoVerticalRel", vec!["y"]),
            ("SVGPathSegMovetoAbs", vec!["x", "y"]),
            ("SVGPathSegMovetoRel", vec!["x", "y"]),
            ("SVGPoint", vec!["x", "y"]),
            ("SVGPreserveAspectRatio", vec!["align", "meetOrSlice"]),
            ("SVGRect", vec!["x", "y", "width", "height"]),
            ("SVGSVGElement", vec!["zoomAndPan"]),
            ("SVGScriptElement", vec!["type", "crossOrigin"]),
            (
                "SVGStyleElement",
                vec!["xmlspace", "type", "media", "title"],
            ),
            ("SVGViewElement", vec!["zoomAndPan"]),
            ("SVGZoomAndPan", vec!["zoomAndPan"]),
            ("ShadowRoot", vec!["innerHTML"]),
            (
                "SourceBuffer",
                vec![
                    "mode",
                    "timestampOffset",
                    "appendWindowStart",
                    "appendWindowEnd",
                ],
            ),
            ("TreeWalker", vec!["currentNode"]),
            ("URL", vec!["href", "protocol"]),
            (
                "VTTCue",
                vec!["lineAlign", "position", "positionAlign", "size"],
            ),
            (
                "VTTRegion",
                vec![
                    "width",
                    "lines",
                    "regionAnchorX",
                    "regionAnchorY",
                    "viewportAnchorX",
                    "viewportAnchorY",
                ],
            ),
            ("WaveShaperNode", vec!["curve"]),
            (
                "XMLHttpRequest",
                vec!["timeout", "withCredentials", "responseType"],
            ),
        ])
    });

pub(crate) static BREAKING_ALLOW_SHARED: Lazy<BTreeMap<&'static str, Vec<&'static str>>> =
    Lazy::new(|| {
        BTreeMap::from_iter([
            (
                "AnalyserNode",
                vec![
                    "getByteFrequencyData",
                    "getByteTimeDomainData",
                    "getFloatFrequencyData",
                    "getFloatTimeDomainData",
                ],
            ),
            ("BiquadFilterNode", vec!["getFrequencyResponse"]),
            ("IirFilterNode", vec!["getFrequencyResponse"]),
            ("MediaKeys", vec!["setServerCertificate"]),
            ("MediaKeySession", vec!["generateRequest", "update"]),
            ("MediaKeyStatusMap", vec!["has"]),
            ("ReadableStreamByobReader", vec!["read"]),
            ("VrMockController", vec!["newPoseMove"]),
            ("VrMockDisplay", vec!["setPose"]),
            (
                "WebGl2RenderingContext",
                vec![
                    "bufferData",
                    "bufferSubData",
                    "clearBufferfv",
                    "clearBufferiv",
                    "clearBufferuiv",
                    "compressedTexImage2D",
                    "compressedTexImage3D",
                    "compressedTexSubImage2D",
                    "compressedTexSubImage3D",
                    "getBufferSubData",
                    "uniform1fv",
                    "uniform1iv",
                    "uniform1uiv",
                    "uniform2fv",
                    "uniform2iv",
                    "uniform2uiv",
                    "uniform3fv",
                    "uniform3iv",
                    "uniform3uiv",
                    "uniform4fv",
                    "uniform4iv",
                    "uniform4uiv",
                    "uniformMatrix2fv",
                    "uniformMatrix2x3fv",
                    "uniformMatrix2x4fv",
                    "uniformMatrix3fv",
                    "uniformMatrix3x2fv",
                    "uniformMatrix3x4fv",
                    "uniformMatrix4fv",
                    "uniformMatrix4x2fv",
                    "uniformMatrix4x3fv",
                    "vertexAttribI4iv",
                    "vertexAttribI4uiv",
                    "vertexAttrib1fv",
                    "vertexAttrib2fv",
                    "vertexAttrib3fv",
                    "vertexAttrib4fv",
                ],
            ),
            (
                "WebglMultiDraw",
                vec![
                    "multiDrawArraysInstancedWEBGL",
                    "multiDrawArraysWEBGL",
                    "multiDrawElementsInstancedWEBGL",
                    "multiDrawElementsWEBGL",
                ],
            ),
            (
                "WebGlRenderingContext",
                vec![
                    "bufferData",
                    "bufferSubData",
                    "compressedTexImage2D",
                    "compressedTexSubImage2D",
                    "uniform1fv",
                    "uniform1iv",
                    "uniform2fv",
                    "uniform2iv",
                    "uniform3fv",
                    "uniform3iv",
                    "uniform4fv",
                    "uniform4iv",
                    "uniformMatrix2fv",
                    "uniformMatrix3fv",
                    "uniformMatrix4fv",
                    "vertexAttrib1fv",
                    "vertexAttrib2fv",
                    "vertexAttrib3fv",
                    "vertexAttrib4fv",
                ],
            ),
        ])
    });

pub(crate) static UNFLATTENED_ATTRIBUTES: Lazy<BTreeMap<&'static str, Vec<&'static str>>> =
    Lazy::new(|| {
        BTreeMap::from_iter([
            ("CanvasRenderingContext2D", vec!["strokeStyle", "fillStyle"]),
            ("IDBFileHandle", vec!["location"]),
            ("KeyframeEffect", vec!["target"]),
            (
                "OffscreenCanvasRenderingContext2D",
                vec!["strokeStyle", "fillStyle"],
            ),
            ("VTTCue", vec!["line", "position"]),
            ("WaveShaperNode", vec!["curve"]),
        ])
    });
