Skip to content

Commit 54aa108

Browse files
ramettaBenjamin-Dobell
authored andcommitted
Update needs_quotes_regex
1 parent 1711be1 commit 54aa108

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/jsb.editor/src/jsb.editor.codegen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ function replace_var_name(name: string) {
835835
return typeof rep !== "undefined" ? rep : name;
836836
}
837837

838-
const needs_quotes_regex = /^(?![$_])[^\w$]|[^\w$]/;
838+
const needs_quotes_regex = /^(?![$_A-Za-z])|[^\w$]/;
839839
const quoted_escape_map: Record<string, string> = {
840840
'"': '\\"',
841841
'\\': '\\\\',
@@ -2027,7 +2027,7 @@ class TypeDescriptorWriter extends BufferingWriter {
20272027
return;
20282028
}
20292029

2030-
indent.line(`"${name_string(key)}"${value.optional ? '?' : ''}: `);
2030+
indent.line(`${name_string(key)}${value.optional ? '?' : ''}: `);
20312031
const prop_writer = new TypeDescriptorWriter(indent, true);
20322032
prop_writer.serialize_type_descriptor(value);
20332033
prop_writer.finish();

0 commit comments

Comments
 (0)