Fix library_browser.js use of assertions with ASSERTIONS=0
BTW is there any way we could automatically drop asserts through the compiler if ASSERTIONS=0? I've come across this a few times now, seems error prone the way it's done atm.
Yes we have thought about perhaps removing these using tools/acorn-optimizer.mjs... is that what you meant by "automatically drop asserts through the compiler". I'm not sure how easy it would be, but it should be possible, and it would make the input code easier to read for sure.
I'm curious why non of our existing tests are hitting this error. Do we not run any browser tests with assertions disabled?
Oh, this is only an issue in STRICT mode I believe and maybe we don't run browser tests in STRICT mode yet.
Can I ask how you ran into this bug? Are you using STRICT mode? Or MINIMAL_RUNTIME perhaps?
I'm curious why non of our existing tests are hitting this error. Do we not run any browser tests with assertions disabled?
Oh, this is only an issue in STRICT mode I believe and maybe we don't run browser tests in STRICT mode yet.
Can I ask how you ran into this bug? Are you using
STRICTmode? OrMINIMAL_RUNTIMEperhaps?
Yup we run STRICT, but not MINIMAL_RUNTIME
Could you perhaps add a -sSTRICT to one or more of the browser tests and verify that they then fail without this change? (Perhaps test_html5_core?)
Have these issues already been fixed or should we still try to land this change?