This repository was archived by the owner on Mar 13, 2018. It is now read-only.
This repository was archived by the owner on Mar 13, 2018. It is now read-only.
Bad node.js detection #10
Open
Description
stacky uses this code to detect Node.js.
var isNode = new Function('try {return this===global;}catch(e){return false;}');
However this way of detecting node is completely wrong.
First issue, the practical one. If you use the <script>
version of babel-polyfill
this code will declare that the browser isNode and stacky will attempt to require
things.
Second problem, the idealistic one. Adding global
to browsers was a proposal that made it to stage-3, i.e. nearly included into the standard and implementation attempted by browsers.
This kind of irresponsible code that equates global
to Node.js/CommonJS/require is the reason we're having an issue with getting that to stage-4.
Metadata
Metadata
Assignees
Labels
No labels