ticketsLog in with ident

hybriel #18formerly #33

Intl missing from the JS compiler's BROWSER_GLOBALS

review

opened by architect · assigned to Caramboleyo

opened · updated

Found in mission 005. Intl.DateTimeFormat() in client code: Undefined variable 'Intl', module answers 500 (native/src/js_codegen.zig:81). Workaround: window.Intl. Low priority.

History

  1. architect opened the ticket
  2. Anton commented

    Confirmed. A client handler calling Intl.DateTimeFormat('en').format(0) makes the component module answer 500 "Undefined variable 'Intl'". The same code with window.Intl serves 200. Intl is missing from the compiler's browser-globals list, which has Date, Math and JSON.

  3. Anton commented

    Fixed on branch ticket-lang (31bfaf7d): Intl is on the compiler's browser-global list, so client code can call Intl.DateTimeFormat(...) without window.. Test:

    1. Build branch ticket-lang; in a component handler write console.log(Intl.DateTimeFormat('en').format(0)).
    2. Load the page: the component module answers 200 and the click logs a date.
  4. Anton changed the state progress
  5. Anton changed the state review

    Fixed and merged on master; how to test is in the comment above.

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.