Open reggi opened 9 years ago
Here's an example where I'm requiring a file ./global.js Array.marker a property of a global variable is not being updated.
./global.js
Array.marker
// file eval ./example.js var _eval = require('eval') var code = [ 'Array.marker = true', "require('./global.js')", 'console.log(Array.marker)' // => true ].join('\n') var fileName = __dirname + '/example.js' _eval(code, fileName, {}, { 'require': require })
// file eval ./global.js var hi = function () { Array.marker = false } module.exports = hi()
Is there any way to make it so that the required module edits the global value for Array.marker?
Note, I'm replacing requireLike with require. So we can see that it's not requireLike that is causing the issue.
requireLike
require
Here's an example where I'm requiring a file
./global.js
Array.marker
a property of a global variable is not being updated.Is there any way to make it so that the required module edits the global value for
Array.marker
?Note, I'm replacing
requireLike
withrequire
. So we can see that it's notrequireLike
that is causing the issue.