Skip to content

Commit 7339630

Browse files
committed
Tweak variant JS value example to be more like TypeScript/wit-bindgen
1 parent 08f2ea6 commit 7339630

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

design/mvp/Explainer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ Notes:
988988
* In lieu of an existing standard JS representation for `variant`, the JS API
989989
would need to define its own custom binding built from objects. As a sketch,
990990
the JS values accepted by `(variant (case "a" u32) (case "b" string))` could
991-
include `{ a: 42 }` and `{ b: "hi" }`.
991+
include `{ tag: 'a', value: 42 }` and `{ tag: 'b', value: "hi" }`.
992992
* For `union` and `option`, when Web IDL doesn't support particular type
993993
combinations (e.g., `(option (option u32))`), the JS API would fall back to
994994
the JS API of the unspecialized `variant` (e.g.,

0 commit comments

Comments
 (0)