mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
The exemption for `f.apply(this, ...)` and `f.call(this, ...)` dropped SC1090 for every module export that passes `this` on. When the function it reaches reads `this`, Node gives it the module object, and the direct module call has none, so the result differed from Node. A `this` that is passed on now counts as unread only when the function it goes to provably ignores its `this`: an arrow, a function that uses `this` only to pass it on to such functions, or what a known function returns, with its parameters bound to the call's arguments and never assigned. The analysis follows at most six calls and functions, and refuses otherwise. Effect 4's provideService still compiles: it passes `this` to what dual(3, body) returns, which passes it on only to the arrow it was given. Passing `this` on to a function that reads it now refuses, directly, through such a factory, or when the factory reassigns its parameter.