js-on-sx: getOwnPropertyDescriptor skips internal __proto__/__js_order__
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 28s

This commit is contained in:
2026-05-10 00:13:08 +00:00
parent 25b30788b4
commit ce067e32a4
2 changed files with 3 additions and 0 deletions

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-10 — **`Object.getOwnPropertyDescriptor` skips internal `__proto__` and `__js_order__` keys.** Was returning a regular property descriptor for our internal `__proto__` and `__js_order__` markers — `Object.getOwnPropertyDescriptor({__proto__: null}, "__proto__")` returned `{configurable, enumerable, value: null, writable}` instead of `undefined` per spec. Added a `(js-key-internal? sk)` short-circuit in the descriptor path that returns `:js-undefined` for internal keys. Result: language/expressions/object 13/30 → 16/30. Object 30/30 holds, getOwnPropertyDescriptor 28/30. conformance.sh: 148/148.
- 2026-05-09 — **Object literal spread `{...src}` parses + executes.** Per ES spec, object literals can include `...expr` to copy own enumerable properties from a source. `jp-parse-object-entry` was rejecting the leading `...` punct. Added a parser branch that records the AST under `:spread`. `js-transpile-object` emits `(js-obj-spread! _obj <src-expr>)` for spread entries, alongside the existing `(js-obj-set! _obj k v)` for regular entries. New `js-obj-spread!` runtime helper: dict source copies own enumerable keys (skipping internal `__js_order__` / `__proto__`); string source copies each character at its numeric index; list source copies elements at their numeric index; null/undefined no-op. Result: language/expressions/array 5/30 → 13/30 (+8). Object 30/30 holds. conformance.sh: 148/148.
- 2026-05-09 — **`Object.getOwnPropertyNames` throws on null/undefined and includes `"length"` for strings/arrays.** Was returning `(list)` for non-list/non-dict inputs; per spec it ToObject's the argument and returns own keys including the implicit `"length"` property for strings/arrays. Added explicit branches: null/undefined → TypeError, string → `["0","1",…,"n-1","length"]` via `js-string-keys-loop` then append, list → indices + `"length"`, dict → existing ordered path. Result: built-ins/Object/getOwnPropertyNames 19/30 → 20/30. Object 30/30 holds. conformance.sh: 148/148.