Skip to content

Commit

Permalink
Merge pull request #225 from jow-/compiler-fix-keyword-property-label…
Browse files Browse the repository at this point in the history
…s-after-spread

compiler: properly treat property names after spread expressions
  • Loading branch information
jow- authored Sep 23, 2024
2 parents 6e88c62 + 94d1211 commit fa22732
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
17 changes: 17 additions & 0 deletions tests/custom/99_bugs/47_compiler_no_prop_kw_after_spread
Original file line number Diff line number Diff line change
@@ -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 --

0 comments on commit fa22732

Please sign in to comment.