Conversation
|
This change affects the quality of platform abstraction. The code inside Effectively you're making the abstraction layer very needy and very tied to one specific platform (node) — whilst the code using that abstraction doesn't even care. It defeats the purpose of having abstraction in the first place. Rather than provide a small easy-to-control gateway to the platform this slowly grows to encompass every feature, and in ad-hoc inconsistent way too (consider Object.create which isn't as omnipresent yet is used indiscriminately unabstracted). And of course ChakraHost fails to allow for setTimeout too! Naturally, as this addition is an ad-hoc artificial extra way out of sync with the intention of |
Right now if opening
tsc.tsin vscode you will see errors on thesetTimeoutreferences. This is because we assumed a globalsetTimeoutexists for tsc, however node and lib.d.ts has different return types forsetTimeout. It is not correct to assume the existence of the globalsetTimeout, this PR moves the implementation tosysand add feature detection.