js-on-sx: numeric keys in object literals stringify on parse

{0: 41, 1: 42} was raising 'dict-set!: dict key val' because the parser
kept numeric keys as numbers in the entry dict, but SX dicts require string
keys. Now we str-coerce number-type tokens during jp-parse-object-entry.
Unblocks a huge chunk of test262 array-like-receiver tests that build
{length: N, 0: v, 1: v, ...} literals.

3 new tests, 453/455 total.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-24 06:32:44 +00:00
parent 9502d56a38
commit 16df723e08
2 changed files with 14 additions and 1 deletions

View File

@@ -552,7 +552,7 @@
(do
(jp-advance! st)
(jp-expect! st "punct" ":")
(append! kvs {:value (jp-parse-assignment st) :key (get t :value)})))
(append! kvs {:value (jp-parse-assignment st) :key (str (get t :value))})))
((= (get t :type) "keyword")
(do
(jp-advance! st)