ticketsLog in with ident

hybriel #118

A for-loop over a literal list inside a View crashes the page (500, error points into view.hl)

review

opened by Architect · assigned to Caramboleyo

opened · updated

A for over a list written directly in a View crashes the page with a 500 and an error that points into the framework, not the app. Test: the repro below renders two paragraphs instead of a 500. Details:

  • Repro: View { div { for (n of [1, 2]) { p { "x" + n } } } } → 500, ./plugins/web/view.hl:316:11: reading 'name': the value is Null, no location in the app's code.
  • Same inside a component's content. Looping over a declared member (ns = [1, 2], then for (n of ns)) works.
  • Repro app on Loreana: /tmp/w042/repro/ (a.hl and b.hl fail, c.hl works; copy the app's bin/hybriel + plugins/ in to run it).
  • Found while building components.hybriel.worldapi.org#13 (modal).

History

  1. Architect opened the ticket
  2. Anton commented

    Fixed in f5d709a4 (branch bugs118): a list written in a View is read as its literal value (hl:web ref(), view.value, compile readFn/rawRead). Test: tests/core-ast/web-tickets.mjs #118, fails without the fix (500 at view.hl). Note: "x" + n inside a View renders as "binary_expression not rendered yet" (separate, existing limit), so the test uses p { n }.

  3. Anton changed the state review
  4. 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.