You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
__spreadArrays throws 'Cannot read property 'length' of null' when --strictNullChecks is off #33549
Expected behavior:
No error should be produced by this code.
Actual behavior:
VM690:3 Uncaught TypeError: Cannot read property 'length' of null
at __spreadArrays (eval at <anonymous> (main-0.js:1018), <anonymous>:3:82)
at foo (eval at <anonymous> (main-0.js:1018), <anonymous>:11:13)
at eval (eval at <anonymous> (main-0.js:1018), <anonymous>:14:1)
at main-0.js:1018
Array-spreading null will result in an error when you target a version that supports this syntax, so I think it's fair to say that the transpiled version for other versions should fail as well.
Martin Johns (@MartinJohns) in previous versions of Typescript this worked without any errors. This is quite a breaking change. So I'd be ok if this was reported as a breaking change and also provided some more adequate error message.
But since it just fails with an ugly message and nobody warned that we need to update our codebase, I see it as a bug.
Activity
MartinJohns commentedon Sep 23, 2019
Array-spreading
nullwill result in an error when you target a version that supports this syntax, so I think it's fair to say that the transpiled version for other versions should fail as well.IMO this is a bug in your code.
KirillMetrik commentedon Sep 23, 2019
Martin Johns (@MartinJohns) in previous versions of Typescript this worked without any errors. This is quite a breaking change. So I'd be ok if this was reported as a breaking change and also provided some more adequate error message.
But since it just fails with an ugly message and nobody warned that we need to update our codebase, I see it as a bug.
RyanCavanaugh commentedon Sep 23, 2019
Improved spec compliance is always considered a bug fix. I agree we should have put this in the blog post, but it's a bit late now.
typescript-bot commentedon Sep 25, 2019
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.