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
The normalized code tries to read require from the global object, but in node, require is declared in the so-called "module" scope. Hence, the normalized code fails with a ReferenceError. I wonder if we can handle this?
The text was updated successfully, but these errors were encountered:
One thought: it looks like module, which refers to the current module object, is a property of the global object in node. So maybe we could special-case accesses to certain "global" variables known to be properties of module, like require, and rewrite those as accessing properties of __global['module']?
I haven't looked into normalising node.js code yet. As you suggest, the rewriting of global variable references would have to be changed to take module into account, but I'm unclear about the details.
Consider normalizing the following node.js code:
The normalized code tries to read
require
from the global object, but in node,require
is declared in the so-called "module" scope. Hence, the normalized code fails with aReferenceError
. I wonder if we can handle this?The text was updated successfully, but these errors were encountered: