From acfc69ec7e3470f8682e655af289a254a1c01a2d Mon Sep 17 00:00:00 2001 From: JustOff Date: Wed, 13 Mar 2019 18:15:07 +0200 Subject: Support string default values for unions containing USVString --- dom/bindings/Codegen.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index cb93e4897f..5c4aa746d5 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -4355,7 +4355,9 @@ def handleDefaultStringValue(defaultValue, method): passing as the second argument of handleDefault; in particular it does not end with a ';' """ - assert defaultValue.type.isDOMString() or defaultValue.type.isByteString() + assert (defaultValue.type.isDOMString() or + defaultValue.type.isUSVString() or + defaultValue.type.isByteString()) return ("static const %(char_t)s data[] = { %(data)s };\n" "%(method)s(data, ArrayLength(data) - 1)") % { 'char_t': "char" if defaultValue.type.isByteString() else "char16_t", -- cgit v1.2.3