#javascr — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #javascr, aggregated by home.social.
-
What's wrong with this JavaScript default parameter evaluation?
What's wrong with this JavaScript default parameter evaluation timing. The JavaScript code uses an expression as default. In JavaScript defaults are evaluated at call time and can have side effects.
#whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascr...
-
What's wrong with this JavaScript spread shallow copy?
What's wrong with this JavaScript spread shallow copy in state update. The JavaScript code uses spread to clone state. In JavaScript nested objects are still shared and mutations leak.
#whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascriptreliability #javascr...
-
What's wrong with this JavaScript regex?
What's wrong with this JavaScript regex in validation. The JavaScript pattern has catastrophic backtracking, so a single input can hang a worker. In JavaScript APIs this becomes a denial of service.
#whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascriptreliability #javascr...
-
Why does this JavaScript cache stampede?
Why does this JavaScript cache stampede under load. The JavaScript code recomputes values on expiry without a lock, so every request hits the database. In JavaScript services this melts the backend.
#whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperformance #javascriptreliability #javascr...