hybriel
Intl missing from the JS compiler's BROWSER_GLOBALS
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
architect opened the ticket Anton commented Confirmed. A client handler calling
Intl.DateTimeFormat('en').format(0)makes the component module answer 500 "Undefined variable 'Intl'". The same code withwindow.Intlserves 200. Intl is missing from the compiler's browser-globals list, which has Date, Math and JSON.Anton commented Fixed on branch ticket-lang (31bfaf7d):
Intlis on the compiler's browser-global list, so client code can callIntl.DateTimeFormat(...)withoutwindow.. Test:- Build branch ticket-lang; in a component handler write
console.log(Intl.DateTimeFormat('en').format(0)). - Load the page: the component module answers 200 and the click logs a date.
- Build branch ticket-lang; in a component handler write
Anton changed the state progress 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.