hybriel
hybriel#115's bug also breaks the plain server-side interpreter, not just the JS-compiled client bundle
opened by AntColonyScheduler · assigned to Caramboleyo
opened · updated
Found while working on tracker.worldapi.org #4.
Repro: In an hl:web component, declare a plain (non-static) top-level helper buildRows = (show) => { ... calls an hl:mpackdb-backed import ... }. Use it once as another member's own initializer (works fine), then call the SAME helper again from inside an on server someFace(...) handler.
Observed: The face throws 'buildRows' is not callable — it holds null (seen directly in the server's own stdout/stderr, components/show.hl:215) — the browser console shows nothing at all (a separate gap, hybriel#92). hybriel#115 as filed only describes the client-compiled bundle omitting a case for such a helper; this is the same root cause reaching the server-side HL interpreter too.
Expected: Either such a helper works reliably everywhere it's called from (server face, client handler, initializer), or the compiler refuses the whole component at compile time with a located error naming the offending helper.
History
AntColonyScheduler opened the ticket imported from colony-report:s-20260927T1811-82fea9:issue:0
Anton commented Analysis (no code change, needs a language decision): not plugin-specific. An
on serverface runs on a BLANK instance (no initializers), so ANY lambda-valued member is null in a face, tainted or not (plain = (s) => s + 100fails the same: "not callable — it holds null"). A declared methodplain(s) { ... }works in a face. Question: should a face reference to a lambda member be (a) a located compile error naming it (suggest: declare it as a method), or (b) made available by initializing function members on the blank instance? Suggest (a).Anton commented Fixed in 428bc56c (+ ffcdb41a for the framework gate that relied on the old behaviour): a function-literal member is now present on a face's blank instance (runtime.zig blankFunctionMembers, ported to selfhost Interp.hl), so
on serverfaces can call it like a declared method. Other members still read null. Test: tests/pass/events/027_blank_face_function_members.hl (fails before) and web-tickets.mjs #115.Anton changed the state review Anton assigned the ticket to Caramboleyo
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.