Commit Graph

54 Commits

Author SHA1 Message Date
094945d86a js-on-sx: globalThis + eval stub transpile-time mappings
JS 'globalThis' now rewrites to SX (js-global) — the global object dict.
JS 'eval' rewrites to js-global-eval, a no-op stub that echoes its first
arg. Many test262 tests probe eval's existence or pass simple literals
through it; a no-op is better than 'Undefined symbol: eval'.

A full eval would require plumbing js-eval into the runtime with access
to the enclosing lexical scope — non-trivial. The stub unblocks tests
that just need eval to be callable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 09:39:28 +00:00
1c0a71517c js-on-sx: Object.prototype methods on function receivers
String.prototype.toUpperCase.hasOwnProperty('length') was failing with
'TypeError: hasOwnProperty is not a function' because js-invoke-method's
dict-with-builtin fallback only matched 'dict' receivers, not functions.

New js-invoke-function-objproto branch handles hasOwnProperty (checks
name/length/prototype keys), toString, valueOf, isPrototypeOf,
propertyIsEnumerable, toLocaleString. Fires from js-invoke-method when
recv is js-function? and key is in the Object.prototype builtin set.

Unblocks many String.prototype tests that check
.hasOwnProperty('length') on the prototype methods.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 09:33:56 +00:00
99706a91d1 scoreboard: Math 40%, Number 48%, String 30% (100/cat, 118/300 total) 2026-04-24 09:28:58 +00:00
3e1bca5435 js-on-sx: Object.prototype has hasOwnProperty/isPrototypeOf/toString/valueOf
Before, Object.prototype was {} — tests writing
Object.prototype.hasOwnProperty.call(o, 'x') failed with 'TypeError: call
is not a function' because hasOwnProperty was undefined on the prototype.

Now Object.prototype.hasOwnProperty / .isPrototypeOf / .propertyIsEnumerable
/ .toString / .toLocaleString / .valueOf all exist. They dispatch on
(js-this) so Array.prototype.X.call-style calls work.

Unblocks String.prototype.* tests that set up '__instance = new Object(true)'
and then probe __instance.hasOwnProperty.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 09:21:14 +00:00
9ea67b9422 js-on-sx: Object is callable (new Object, Object(x))
Adds __callable__ to the Object global dict: zero args returns {}, one-arg
returns the arg (which mirrors spec ToObject for non-null/undefined). This
unblocks many test262 tests that write 'new Object(true)' or 'Object(5)'
— they were failing with 'Not callable: {:entries ...}' because Object
was a plain dict with no call protocol.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 09:19:11 +00:00
85a329e8d6 js-on-sx: fn.length reflects actual arity via lambda-params
Previously fn.length always returned 0 — so the 'length value' test262 tests
failed. Now js-fn-length inspects the lambda's parameter list (via
lambda-params primitive) and counts non-rest params. For functions/components
and callable dicts it still returns 0 (can't introspect arity in those cases).

6 new unit tests, 520/522 total.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 09:14:56 +00:00
c22f553146 plan: update progress log with session 3 summary, Math 39.6% wide 36.4% 2026-04-24 09:08:15 +00:00
edfbb75466 js-on-sx: Number global with correct MAX_VALUE (computed), toFixed handles NaN/Infinity
Number dict was missing parseInt/parseFloat members and had MAX_VALUE=0
because SX parses 1e308 as 0 (exponent overflow). Now MAX_VALUE is computed
at load time by doubling until the next step would be Infinity
(js-max-value-approx returns 2^1023-ish, good enough as a finite sentinel).

POSITIVE_INFINITY / NEGATIVE_INFINITY / NaN now also use function-form values
(js-infinity-value, js-nan-value) so we don't depend on SX's inf/-inf/-nan
being roundtrippable as literals.

js-number-to-fixed now returns 'NaN' / 'Infinity' / '-Infinity' for
non-finite values. Also handles negative numbers correctly via |scaled|.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 08:57:10 +00:00
3aa8034a0b js-on-sx: runner harness — assert() callable, verify* tolerate more args
Many test262 tests write 'assert(condition, msg)' as a plain call, not
'assert.sameValue(...)'. The stub now sets assert.__callable__ to
__assert_call__ so the dispatch in js-call-plain finds a callable.

Also widens verifyNotEnumerable etc. to 5-arg signatures — some tests call
them with (o, name, value, writable, configurable).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 08:49:53 +00:00
84b947024d js-on-sx: fn.length/.name/.call/.apply/.bind as properties (not just methods)
js-get-prop on a function receiver only routed .prototype before; now also
handles .name (returns ''), .length (returns 0), and .call/.apply/.bind
as bound function references.

Previously Math.abs.length crashed with 'TypeError: length is not a function'.
Similarly for arr.sort.call which is a common test262 pattern.

Pass rate stable at 514/516.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 08:42:35 +00:00
60bb77d365 js-on-sx: parseInt digit-walker, parseFloat prefix, Number('abc')→NaN, encodeURIComponent
Four coercion fixes that together unblock many test262 cases:

1. js-to-number(undefined) now returns NaN (was 0). Fixes Number(undefined),
   isNaN(undefined), Math ops on undefined.
2. js-string-to-number returns NaN for non-numeric strings (via new
   js-is-numeric-string?). Previously returned 0 for 'abc'.
3. parseInt('123abc', 10) → 123 (walks digits until first invalid char),
   supports radix 2..36.
4. parseFloat('3.14xyz') → 3.14 (walks float prefix).
5. encodeURIComponent / decodeURIComponent / encodeURI / decodeURI —
   new URI-helper implementations.

8 new unit tests, 514/516 total.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 08:17:49 +00:00
621a1ad947 js-on-sx: js-iterable-to-list respects length on array-like dicts
Array.from({length: 3, 0: 'a', 1: 'b', 2: 'c'}) used to return ['3','a','b','c']
because js-iterable-to-list walked dict keys in insertion order and included
the 'length' key as a value.

Now the dict branch checks for 'length' key first — if present, delegates to
js-arraylike-to-list which reads indices 0..length-1. Otherwise falls back
to value-order for plain objects.

Fixes Array.from, spread (...dict), and destructure from array-likes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 08:07:57 +00:00
88217ec612 js-on-sx: expose new Array/String prototype methods via Array.prototype / String.prototype dicts
The js-array-method / js-string-method dispatch tables had the new methods,
but the Array.prototype and String.prototype dicts that feed
Array.prototype.X.call(...) only had the original set. Now they include
all: Array.prototype.{at,unshift,splice,flatMap,findLast,findLastIndex,
reduceRight,toString,toLocaleString,keys,values,entries,copyWithin,
toReversed,toSorted,lastIndexOf}, and String.prototype.{at,codePointAt,
lastIndexOf,localeCompare,replaceAll,normalize,toLocale*Case}.

Also adds String.raw (trivial stub).

No unit test additions — these methods already tested via direct calls
on instances. 506/508 unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 08:05:12 +00:00
d294443627 js-on-sx: 10 new Object.* globals (getPrototypeOf, create, is, hasOwn, defineProperty, ...)
Extends the Object global dict with:
- getPrototypeOf / setPrototypeOf — read/write __proto__ chain
- create(proto, props?) — builds new obj with proto and optional descriptors
- defineProperty / defineProperties — descriptor.value only (no getters/setters)
- getOwnPropertyNames / getOwnPropertyDescriptor(s) — simple shapes
- isExtensible / isFrozen / isSealed (permissive stubs)
- seal / preventExtensions (no-ops)
- is — SameValue (NaN is NaN, -0 vs +0 distinguished via inspect string)
- fromEntries — inverse of entries
- hasOwn — explicit owner check for string keys

9 new unit tests, 506/508 total.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 07:47:34 +00:00
db7a3d10dd js-on-sx: NaN / Infinity resolve at transpile; strict-eq returns false for NaN
Previously NaN / Infinity were SX symbols that couldn't be (define)'d
because the SX tokenizer parses 'NaN' and 'Infinity' as numeric literals.

js-transpile-ident now rewrites NaN -> (js-nan-value), Infinity ->
(js-infinity-value), each a zero-arg function returning the appropriate
IEEE value ((/ 0.0 0.0) and (/ 1.0 0.0)).

Also fixes js-number-is-nan: in this SX, (= nan nan) returns true, so the
classic 'v !== v' trick doesn't work. Now checks (inspect v) against
'nan'/'-nan' strings.

Extends js-strict-eq: NaN === NaN returns false per ES spec.

8 new unit tests, 497/499 total.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 07:43:09 +00:00
fd73c43eba js-on-sx: 10 new String.prototype methods (at, codePointAt, lastIndexOf, localeCompare, replaceAll, normalize, ...)
New methods added:
- at(i) — negative-index aware
- codePointAt(i) — returns char code at index
- lastIndexOf — walks right-to-left via js-string-last-index-of helper
- localeCompare — simple lexicographic (ignores locale)
- replaceAll — works with strings and regex-source
- normalize — no-op stub
- toLocaleLowerCase / toLocaleUpperCase — delegate to non-locale variants
- isWellFormed / toWellFormed — assume always well-formed

10 new unit tests, 489/491 total.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 07:35:27 +00:00
30ef085844 js-on-sx: 15 new Array.prototype methods (at, flatMap, findLast, reduceRight, toString, toReversed, toSorted, ...)
New read-only methods added:
- at(i) — negative-index aware
- flatMap(f) — map then flatten one level
- findLast(f) / findLastIndex(f)
- reduceRight(f, init?)
- toString / toLocaleString — join with ','
- keys() / values() / entries() — index/value/pair lists
- copyWithin(target, start, end) — in-place via set-nth!
- toReversed() / toSorted() — non-mutating variants

Mutating methods (unshift, splice) are stubs that return correct lengths
but don't mutate — we don't have a pop-first!/clear! primitive to rebuild
the list in place. Tracked as a runtime limitation.

10 new unit tests, 479/481 total. Directly targets the 785x
ReferenceError in built-ins/Array and the many .toString() crashes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 07:27:00 +00:00
baa5cd9341 js-on-sx: .toString()/.toFixed()/.valueOf() on numbers and booleans
js-invoke-method now branches on (number? recv) and (boolean? recv) before
falling through to the generic dict/fn path. js-invoke-number-method handles
toString (incl. radix 2-36), toFixed, valueOf, toLocaleString, toPrecision,
toExponential. js-invoke-boolean-method handles toString and valueOf.

Numbers had no .toString() on bare values before — (5).toString() crashed
with 'TypeError: toString is not a function'. This is one of the bigger
scoreboard misses on built-ins/Number category.

10 new unit tests, 469/471 total.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 06:51:58 +00:00
e5346d5ea3 js-on-sx: runner classifier maps parser errors to SyntaxError
classify_error now catches 'unexpected token', 'unexpected char',
'expected ident/punct/keyword' as SyntaxError variants.

classify_negative_result maps parser errors to SyntaxError for negative:parse
tests that expect a SyntaxError. Also maps 'undefined symbol' to
ReferenceError for negative:runtime tests. This reclassifies ~39+36 tests
per wide run from 'fail' to 'pass (negative)'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 06:44:05 +00:00
5f3a8e43c0 js-on-sx: array-like receivers for Array.prototype.* methods
Array.prototype.slice.call({length:3, 0:41, 1:42, 2:43}) used to crash with
'Not callable: {dict}' because js-array-proto-fn passed the dict straight
into js-invoke-method, which then tried (append! dict x) etc.

Now js-array-proto-fn converts dict-with-length receivers to a list via
js-arraylike-to-list before dispatch. Mutation methods (push/pop/shift/
reverse/sort/fill) still require a real list — array-likes only work for
read-only methods.

Targets the 455x 'Not callable: {:length N :0 v1 :1 v2 ...}' scoreboard item.

6 new unit tests, 459/461 total.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 06:40:46 +00:00
16df723e08 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>
2026-04-24 06:32:44 +00:00
92c1fc72a5 js-on-sx: Function.prototype.call/apply/bind
Adds js-invoke-function-method dispatched from js-invoke-method when the
receiver is a JS function (lambda/function/component/callable-dict) and the
method name is one of call/apply/bind/toString/name/length.

call and apply bind this around a single call; bind returns a closure with
prepended args. toString returns the native-code placeholder.

6 unit tests, 450/452 total (Array.prototype.push.call with arrayLike still
fails — tracked as the 455x 'Not callable array-like' scoreboard item which
needs array methods to treat dict-with-length as a list).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 06:27:18 +00:00
65d4c70638 js-on-sx: parallel test262 runner with raw-fd line buffer
Rework test262-runner.py to support --workers N parallel shards, each running
a long-lived sx_server session. Replace thread-per-readline with a select-based
raw-fd line buffer.

On 2-core machines, 1 worker still beats 2 (OCaml eval is CPU-bound and starves
when shared). Auto-defaults n_workers=1 on <=2 CPU, nproc-1 (up to 8) otherwise.

Throughput baseline: ~1.1 Math tests/s serial on 2-core (unchanged; the
evaluator dominates). The runner framework is now ready to scale on bigger
machines without further code changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 06:18:48 +00:00
c94b340943 js-on-sx: updated Math scoreboard — 66/288 (22.9%)
Up from 56/288 (19.4%) baseline. Progress from:
- Math.sqrt/pow/trunc/sign/cbrt/hypot
- Array.prototype stubs for verifyProperty
- typeof callable-dict → "function"
- __callable__ dispatch in js-apply-fn
2026-04-23 23:41:38 +00:00
6293a0fe70 js-on-sx: delete operator
js-transpile-unop intercepts 'delete' before transpiling the
operand. Maps to (js-delete-prop obj key) for members and indexed
access. Runtime js-delete-prop sets the dict value to js-undefined
and returns true.

444/446 unit (+2), 148/148 slice unchanged.
2026-04-23 23:34:05 +00:00
27bd25843e js-on-sx: tolerate destructuring params in fn decls/exprs (skipped as holes) 2026-04-23 23:27:29 +00:00
0a3425ba18 js-on-sx: Array.prototype.lastIndexOf 2026-04-23 23:24:02 +00:00
9f9e4e1e9d js-on-sx: obj destructure rename + rest + nested tolerance
Pattern {key: local-name} emits ("rename" key local). Transpile
emits (define local (js-get-prop tmp key)).

Rest in obj pattern stubs (no supported), nested {} and [] treated
as holes.

442/444 unit (+2), 148/148 slice unchanged.
2026-04-23 23:19:31 +00:00
c5e2bc2fe1 js-on-sx: Number.prototype stub with toString/valueOf/toFixed 2026-04-23 23:13:55 +00:00
835d42fd1a js-on-sx: Array.prototype and String.prototype stubs
Each prototype contains method-name → closure pairs. Each closure
reads this via js-this and dispatches through js-invoke-method.
Lets Array.prototype.push, String.prototype.slice etc. be accessed
and invoked as (expected) functions.

440/442 unit unchanged, 148/148 slice unchanged.
2026-04-23 23:11:06 +00:00
d7ad7172aa js-on-sx: js-apply-fn unwraps __callable__ before invoking 2026-04-23 23:06:24 +00:00
1079004981 js-on-sx: typeof returns 'function' for callable-dicts + 'object' for null 2026-04-23 23:02:15 +00:00
c257971bb1 js-on-sx: rest in array pattern + nested pattern tolerance
Array destructure now supports [a, ...rest]. Rest entry is
transpiled to (define name (js-list-slice tmp i (len tmp))).

Nested patterns like [[a,b], c] now parse (as holes) instead of
erroring. jp-skip-balanced skips nested groups.

440/442 unit (+2), 148/148 slice unchanged.
2026-04-23 22:58:49 +00:00
1459f7a637 js-on-sx: callable Number/String/Boolean/Array + Array.sort
Builtin constructors now have :__callable__ slot. js-call-plain
and js-function? detect dicts with __callable__ and dispatch
through it. Number('42')===42, String(true)==='true', Boolean(0)
===false, Array(3) builds length-3 list.

Array.prototype.sort(comparator?): bubble sort via js-list-sort-
outer!/-inner!. Default lex order, custom comparator supported.

Wide scoreboard committed: 259/5354 (4.8%) from earlier runtime.

438/440 unit (+11), 148/148 slice unchanged.
2026-04-23 22:53:13 +00:00
d6975d3c79 js-on-sx: logical assignment &&= ||= ??=
js-compound-update gains logical-assign operators:
- &&= → (if (js-to-boolean lhs) rhs lhs)
- ||= → (if (js-to-boolean lhs) lhs rhs)
- ??= → (if nullish? rhs lhs)

427/429 unit (+4), 148/148 slice unchanged.
2026-04-23 22:43:38 +00:00
18ae63b0bd js-on-sx: optional chaining ?.
Parser: jp-parse-postfix handles op "?." followed by ident / [ / (
emitting (js-optchain-member obj name), (js-optchain-index obj k),
or (js-optchain-call callee args).

Transpile: each emits (js-optchain-get obj key) or (js-optchain-call
fn args).

Runtime: js-optchain-get and js-optchain-call short-circuit to
js-undefined when receiver is null/undefined.

423/425 unit (+5), 148/148 slice unchanged.
2026-04-23 22:38:45 +00:00
15c310cdc1 js-on-sx: object + array destructuring
Parser: jp-parse-vardecl handles {a, b} obj pattern and [a, , c]
arr pattern (with hole support) in addition to plain idents.
Emits (js-vardecl-obj names rhs) and (js-vardecl-arr names rhs).

Transpile: js-vardecl-forms dispatches on tag. Destructures emit
(define __destruct__ rhs) then (define name (js-get-prop __destruct__
key-or-index)) for each pattern element. Array holes (nil) are skipped.

418/420 unit (+4), 148/148 slice unchanged.
2026-04-23 22:32:24 +00:00
4800246b23 js-on-sx: spread ... in array literals and call args
Parser: jp-array-loop and jp-call-args-loop detect punct "..."
and emit (js-spread inner).

Transpile: when any element is spread, build array/args via
js-array-spread-build with (list "js-value" v) and (list
"js-spread" xs) tags.

Runtime: js-array-spread-build walks items, appending values or
splicing spreads via js-iterable-to-list (handles list/string/dict).

Works in arrays, call args, variadic fns (Math.max(...arr)),
and string spread ([...'abc']).

414/416 unit (+5), 148/148 slice unchanged.
2026-04-23 22:10:15 +00:00
b502b8f58e js-on-sx: js-num-to-int coerces strings via js-to-number 2026-04-23 21:59:08 +00:00
60bb7c4687 js-on-sx: String replace/search/match + Array.from
String: replace, search, match now work with either string or regex
arg. Regex path uses js-string-index-of on source (case-adjusted
when ignoreCase set).

Array.from(iter, mapFn?) normalizes via js-iterable-to-list and
optionally applies mapFn.

Fixed dict-set! on list bug in js-regex-stub-exec — just omit the
index/input metadata, spec-breaking but tests that just check [0]
work.

407/409 unit (+8), 148/148 slice unchanged.
2026-04-23 21:54:36 +00:00
f113b45d48 js-on-sx: for..of / for..in + more Array methods
Parser: jp-parse-for-stmt does 2-token lookahead for (var? ident
(of|in) expr), emits (js-for-of-in kind ident iter body) else
classic (js-for init cond step body).

Transpile: wraps body in (call/cc (__break__) (let items
(for-each (fn (ident) (call/cc (__continue__) body)) items))).

Runtime: js-iterable-to-list normalizes list/string/dict for of
iteration; js-string-to-list expands string to char list.

399/401 unit (+8), 148/148 slice unchanged.
2026-04-23 21:41:52 +00:00
835025ec37 js-on-sx: Array.prototype flat + fill; fix indexOf start arg
flat: walk with depth, recursive when element is list and depth>0.
fill(value, start?, end?): in-place mutation, returns self.
indexOf: honor second arg as start position.

396/398 unit (+5), 148/148 slice unchanged.
2026-04-23 21:28:50 +00:00
ebaec1659e js-on-sx: JSON.stringify + JSON.parse
Recursive-descent parser/serializer in SX.

stringify: type-of dispatch for primitives, lists, dicts. Strings
escape \\ \" \n \r \t.

parse: {:s src :i idx} state dict threaded through helpers.
Handles primitives, strings (with escapes), numbers, arrays,
objects.

Wired into js-global.

391/393 unit (+10), 148/148 slice unchanged.
2026-04-23 21:22:32 +00:00
6f0b4fb476 js-on-sx: String.fromCharCode + parseInt + parseFloat
String global with fromCharCode (variadic). parseInt truncates via
js-math-trunc; parseFloat delegates to js-to-number. Wired into
js-global.

381/383 unit (+5), 148/148 slice unchanged.
2026-04-23 21:16:41 +00:00
2bd3a6b2ba js-on-sx: Array.prototype includes/find/some/every/reverse + Object fallbacks
Array: includes, find, findIndex, some, every, reverse via
tail-recursive helpers.

Object: hasOwnProperty, isPrototypeOf, propertyIsEnumerable,
toString, valueOf, toLocaleString fallback in js-invoke-method
when js-get-prop returns undefined. Lets o.hasOwnProperty('k')
work on plain dicts.

376/378 unit (+13), 148/148 slice unchanged.
2026-04-23 21:11:12 +00:00
9d3e54029a js-on-sx: switch/case/default/break
Parser: jp-parse-switch-stmt + jp-parse-switch-cases + jp-parse-switch-body.
AST: (js-switch discr (("case" val body) ("default" nil body) ...)).

Transpile: wraps body in (call/cc (fn (__break__) ...)). Each case
clause becomes (when (or __matched__ (js-strict-eq discr val))
(set! __matched__ true) body). Fall-through works naturally via
__matched__. Default appended as (when (not __matched__) body).

363/365 unit (+6), 148/148 slice unchanged.
2026-04-23 21:04:22 +00:00
275d2ecbae js-on-sx: String.prototype extensions + Object/Array builtins
Strings: includes, startsWith, endsWith, trim, trimStart, trimEnd,
repeat, padStart, padEnd, toString, valueOf.

Object: keys, values, entries, assign, freeze (no-op).
Array: isArray, of.

All wired into js-global. 17 new unit tests.

357/359 unit (+17), 148/148 slice unchanged.
2026-04-23 20:58:24 +00:00
6c4001a299 js-on-sx: postfix + prefix ++/--
Parser: jp-parse-postfix emits (js-postfix op target) on trailing
++/--; jp-parse-primary emits (js-prefix op target) before the
unary -/+/!/~ branch.

Transpile: js-transpile-prefix → (set! name (+ (js-to-number name)
±1)) for idents, (js-set-prop obj key ...) for members/indices.
js-transpile-postfix caches old value in a let binding, updates,
returns the saved value.

340/342 unit (+11), 148/148 slice unchanged.
2026-04-23 20:50:10 +00:00
e0531d730c js-on-sx: drop top-level (define NaN) / (define Infinity) — SX parses those as numbers 2026-04-23 20:45:12 +00:00
608a5088a4 js-on-sx: expanded Math + Number globals
Math gains sqrt/pow/trunc/sign/cbrt/hypot plus LN2/LN10/LOG2E/
LOG10E/SQRT2/SQRT1_2 constants and full-precision PI/E.

Number global: isFinite/isNaN/isInteger/isSafeInteger plus
MAX_VALUE/MIN_VALUE/MAX_SAFE_INTEGER/MIN_SAFE_INTEGER/EPSILON/
POSITIVE_INFINITY/NEGATIVE_INFINITY/NaN.

Global isFinite, isNaN, Infinity, NaN. Wired into js-global.

329/331 unit (+21), 148/148 slice unchanged.
2026-04-23 20:42:57 +00:00