ITADN

Silent failure of an assignment seems likely to cause hard-to-find bugs.

#3Openbrad4d 创建于 2023-07-06
B
brad4dcommented
One of the most important changes made by the introduction of strict mode was to throw errors in several cases where JS assignments used to silently fail. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode This proposal seems to be re-introducing silent assignment failures. This is especially true if the intention is to allow any form of optional chain on the LHS so long as it ends with `?.prop` or `?.[expr]`. In that case even when you determine that a silent failure has occurred, you don't know which value was `undefined`.
2 条评论