js-on-sx: lexer rejects bare backslash in source
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 38s

This commit is contained in:
2026-05-09 02:41:58 +00:00
parent 0b7d88bbe1
commit e5709c5aec
2 changed files with 4 additions and 0 deletions

View File

@@ -680,6 +680,8 @@
(do (js-emit! "op" "^" start) (advance! 1)))
((= ch "~")
(do (js-emit! "op" "~" start) (advance! 1)))
((= ch "\\")
(error "Unexpected char '\\' in source"))
(else (advance! 1)))))
(define
scan!

View File

@@ -158,6 +158,8 @@ Each item: implement → tests → update progress. Mark `[x]` when tests green.
Append-only record of completed iterations. Loop writes one line per iteration: date, what was done, test count delta.
- 2026-05-09 — **JS lexer rejects bare `\` in source (e.g. `{` outside an identifier-escape context).** Was silently advancing past unknown chars in the punctuator-fallback branch, so `{` became `\` (skipped) + ident `u007B`, and `((1))` parsed as something close to `(1)` after our SX-string layer pre-converted half of them. Now `(else (advance! 1))` is a `(error "Unexpected char '\\' in source")` for `\` specifically (other unknown chars still advance — keeps multi-byte UTF-8 idents working at the byte level). Result: language/punctuators 1/11 → 11/11 (full pass), language/literals 25/30 → 28/30, language/identifiers 11/30 → 13/30. Object/Map unchanged. conformance.sh: 148/148.
- 2026-05-09 — **Negative-test classifier maps `js-transpile-assign` and any `js-transpile-*` error to SyntaxError.** `language/types/boolean/S8.3_A2.{1,2}.js` (testing `true=1`/`false=0` reject) raises `js-transpile-assign: unsupported target` at our transpile pass — that's a parse-phase error in test262's sense (the source is structurally invalid before any runtime evaluation), but the runner's classifier didn't recognise the prefix and reported the test as failing. Added `js-transpile-assign` and the broader `js-transpile` prefix to the SyntaxError-mappable patterns in `classify_negative_result`. Result: language/types 26/30 → 28/30 (the two `true = 1` / `false = 0` tests). conformance.sh: 148/148.
- 2026-05-09 — **`Object.getOwnPropertyDescriptor` now returns descriptors for arrays and strings, not just dicts.** Was: `(if (and (dict? o) ...) {...} :js-undefined)` — every list and string returned `undefined`. Extended: lists give `{value: arr[i], writable: true, enumerable: true, configurable: true}` for valid integer indices, plus `{value: arr.length, writable: true, enumerable: false, configurable: false}` for `"length"`. Strings give read-only descriptors for `"length"` and individual code units. The integer-index test reuses `js-int-key?` (added earlier for `__js_order__` integer-key sorting). Result: built-ins/Object/getOwnPropertyDescriptor 50/60 → 54/60, language/arguments-object 12/30 → 13/30. Array unchanged. conformance.sh: 148/148.