Skip to content

Commit 57ca8ad

Browse files
Fix typos and grammar in enum docs. NFC (#26031)
Following #25257 The main change is that there was an inconsistency in the enum values between the three examples
1 parent c718e68 commit 57ca8ad

File tree

1 file changed

+6
-4
lines changed
  • site/source/docs/porting/connecting_cpp_and_javascript

1 file changed

+6
-4
lines changed

site/source/docs/porting/connecting_cpp_and_javascript/embind.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ C++ integer.
840840

841841
.. code:: cpp
842842
843+
enum class Enum { ONE, TWO };
844+
843845
EMSCRIPTEN_BINDINGS(my_enum_example) {
844846
enum_<Enum>("ObjectEnum", enum_value_type::object)
845847
.value("ONE", Enum::ONE)
@@ -848,8 +850,8 @@ C++ integer.
848850
849851
.. code:: javascript
850852
851-
Module.ObjectEnum.ONE.value === 1;
852-
Module.ObjectEnum.TWO.value === 2;
853+
Module.ObjectEnum.ONE.value === 0;
854+
Module.ObjectEnum.TWO.value === 1;
853855
854856
Alternatively, you can use:
855857

@@ -884,8 +886,8 @@ Alternatively, you can use:
884886
Module.StringEnum.ONE === "ONE";
885887
Module.StringEnum.TWO === "TWO";
886888
887-
Whatever the ``enum_value_type`` used, enum values can always be used as arguments
888-
to functions expecting the enum type.
889+
Regardless of the ``enum_value_type`` used, enum values can always be used as
890+
arguments to functions expecting the enum type.
889891

890892
.. code:: cpp
891893

0 commit comments

Comments
 (0)