dawn_node: handle literals on typdef'd interface members
Bug: dawn:1123
Change-Id: Ie7f388a0322b195937aa76ab30b1513ca642b572
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/75901
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_node/interop/WebGPUCommon.tmpl b/src/dawn_node/interop/WebGPUCommon.tmpl
index 8630773..c47c097 100644
--- a/src/dawn_node/interop/WebGPUCommon.tmpl
+++ b/src/dawn_node/interop/WebGPUCommon.tmpl
@@ -84,9 +84,10 @@
{{- if IsDefaultDictionaryLiteral $.Value}}{{template "Type" $.Type}}{}
{{- else if IsTypeName $.Type }}
{{- $ty := Lookup $.Type.Name}}
-{{- if IsEnum $ty }}{{$.Type.Name}}::{{EnumEntryName $.Value.Value}}
+{{- if IsTypedef $ty }}{{Eval "Literal" "Value" $.Value "Type" $ty.Type}}
+{{- else if IsEnum $ty }}{{$.Type.Name}}::{{EnumEntryName $.Value.Value}}
{{- else if IsBasicLiteral $.Value }}{{$.Value.Value}}
-{{- else }}/* Unhandled Type {{printf "ty: %v $.Type.Name: %T $.Value: %T" $ty $.Type.Name $.Value}} */
+{{- else }}/* Unhandled Type {{printf "ty: %T $.Type.Name: %T $.Value: %T" $ty $.Type.Name $.Value}} */
{{- end }}
{{- else if IsSequenceType $.Type }}{{template "Type" $.Type}}{} {{- /* TODO: Assumes the initialiser is empty */}}
{{- else if IsBasicLiteral $.Value }}{{$.Value.Value}}