Index: mojo/public/tools/bindings/generators/mojom_js_generator.py |
diff --git a/mojo/public/tools/bindings/generators/mojom_js_generator.py b/mojo/public/tools/bindings/generators/mojom_js_generator.py |
index 3900e50d3fd12119d795b785335b4a8b9766d17c..e57f3305eba98e4ad4042da2320d4bd4e62ad190 100644 |
--- a/mojo/public/tools/bindings/generators/mojom_js_generator.py |
+++ b/mojo/public/tools/bindings/generators/mojom_js_generator.py |
@@ -133,8 +133,7 @@ def CodecType(kind): |
if mojom.IsAssociatedInterfaceRequestKind(kind): |
return "codec.AssociatedInterfaceRequestNotSupported" |
if mojom.IsEnumKind(kind): |
- element_type = kind.name |
- return "new codec.Enum(%s)" % (element_type) |
+ return "new codec.Enum(%s)" % JavaScriptType(kind) |
if mojom.IsMapKind(kind): |
map_type = "NullableMapOf" if mojom.IsNullableKind(kind) else "MapOf" |
key_type = ElementCodecType(kind.key_kind) |