summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--compiler.c1
-rw-r--r--tests/custom/99_bugs/47_compiler_no_prop_kw_after_spread17
2 files changed, 18 insertions, 0 deletions
diff --git a/compiler.c b/compiler.c
index 1ea0c65..53e61e7 100644
--- a/compiler.c
+++ b/compiler.c
@@ -2060,6 +2060,7 @@ uc_compiler_compile_object(uc_compiler_t *compiler)
/* emit merge operation */
uc_compiler_emit_insn(compiler, 0, I_MOBJ);
+ compiler->parser->lex.no_keyword = true;
continue;
}
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 --