Skip to content

Commit

Permalink
Fix documentation about record<> syntax.
Browse files Browse the repository at this point in the history
Weedle special-cases `record<K,V>` to ensure that the keys are one of its
known string types, so when we write record syntax in UDL is needs to be
`record<DOMString, T>` rather than `record<string, T>`. Bleh.
  • Loading branch information
rfk committed Feb 15, 2021
1 parent 4b40798 commit a5b5a49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/manual/src/internals/lifting_and_lowering.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Calling this function from foreign language code involves the following steps:
| `string` | `RustBuffer` struct pointing to utf8 bytes |
| `T?` | `RustBuffer` struct pointing to serialized bytes |
| `sequence<T>` | `RustBuffer` struct pointing to serialized bytes |
| `record<string, T>` | `RustBuffer` struct pointing to serialized bytes |
| `record<DOMString, T>` | `RustBuffer` struct pointing to serialized bytes |
| `enum` | `uint32_t` indicating variant, numbered in declaration order starting from 1 |
| `dictionary` | `RustBuffer` struct pointing to serialized bytes |
| `interface` | `uint64_t` opaque integer handle |
Expand All @@ -83,7 +83,7 @@ The details of this format are internal only and may change between versions of
| `string` | Serialized `i32` length followed by utf-8 string bytes; no trailing null |
| `T?` | If null, serialized `boolean` false; if non-null, serialized `boolean` true followed by serialized `T` |
| `sequence<T>` | Serialized `i32` item count followed by serialized items; each item is a serialized `T` |
| `record<string, T>` | Serialized `i32` item count followed by serialized items; each item is a serialized `string` followed by a serialized `T` |
| `record<DOMString, T>` | Serialized `i32` item count followed by serialized items; each item is a serialized `string` followed by a serialized `T` |
| `enum` | Serialized `u32` indicating variant, numbered in declaration order starting from 1 |
| `dictionary` | The serialized value of each field, in declaration order |
| `interface` | *Cannot currently be serialized* |
Expand Down
2 changes: 1 addition & 1 deletion uniffi_bindgen/src/bindings/gecko_js/gen_gecko_js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ mod filters {
/// * `Type::Optional` is called "nullable" in Firefox WebIDL. It's
/// represented as `T?` in UDL and WebIDL.
/// * `Type::Map` is called a "record" in Firefox WebIDL. It's represented
/// as `record<string, T>` in UDL, and `record<DOMString, T>` in
/// as `record<DOMString, T>` in UDL, and `record<DOMString, T>` in
/// WebIDL.
///
/// There are also semantic differences:
Expand Down

0 comments on commit a5b5a49

Please sign in to comment.