summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/99_bugs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2024-09-23 16:36:16 +0200
committerJo-Philipp Wich <jo@mein.io>2024-09-23 16:36:16 +0200
commit94d1211ce0b5ed962de990a4427b9dea0c25522f (patch)
tree80788c52943f9bcc5426f90105f7f451ba3c0b0d /tests/custom/99_bugs
parentb610860dd4a0591ff586dd71a50f556a0ddafced (diff)
compiler: properly treat property names after spread expressions
Ensure that unquoted property names following spread expressions in object declaration literals are not treated as keywords. Prior to this fix, an expression such as `{ ...someobj, default: 1 }` would result in a compile time syntax error. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests/custom/99_bugs')
-rw-r--r--tests/custom/99_bugs/47_compiler_no_prop_kw_after_spread17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/custom/99_bugs/47_compiler_no_prop_kw_after_spread b/tests/custom/99_bugs/47_compiler_no_prop_kw_after_spread
new file mode 100644
index 0000000..26f1bff
--- /dev/null
+++ b/tests/custom/99_bugs/47_compiler_no_prop_kw_after_spread
@@ -0,0 +1,17 @@
+Ensure that unquoted property names following spread expressions in object
+declaration literals are not treated as keywords.
+
+-- Testcase --
+{%
+printf("%.J\n", {
+ ...{},
+ for: true
+});
+%}
+-- End --
+
+-- Expect stdout --
+{
+ "for": true
+}
+-- End --