-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems using core-js inside Devtool #230
Comments
w.r.t. that black magic: it's actually the only reliable way of getting access to the global object, unless you forbid But yes, it would probably be better if no globals are ever assumed to be available outside of |
Is there any way to expedite this getting fixed? I've already tracked down the issue and have a solution, it just needs to be implemented. Should I create a PR? |
If var global = require('./_global').document;
module.exports = document && document.documentElement; will fix this issue completely - feel free add a PR. |
It will fix it so the |
Yeah. It probably would be better if Devtool would correctly hide the browser globals, so that even the weird eval trick that core-js uses would return undefined, but fixing that sounds more complicated... maybe I should post a bug there... |
Should be fixed in |
I'm trying to use a node.js app inside an Electron-based debugger, devtool. Devtool has a command line switch, --no-browser-globals, which hides the window, document, and navigator variables from running scripts. The issue I'm running into is that the modules/_html script does this:
module.exports = require('./_global').document && document.documentElement;
The left hand side of the script succeeds, because core-js uses this black magic to grab the window object:
Function('return this')();
But the right hand side fails because it references the document variable. If I change the code to:
module.exports = require('./_global').document && require('./_global').document.documentElement;
It works properly.
The text was updated successfully, but these errors were encountered: