-
Notifications
You must be signed in to change notification settings - Fork 922
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
Improve named export analysis #1649
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pikapkg/snowpack/k27ir9ik3 |
a3f4522
to
d1e506e
Compare
? cjsAutoDetectExportsRuntime(val) | ||
: cjsAutoDetectExportsStatic(val); | ||
? cjsAutoDetectExportsTrusted(val) | ||
: cjsAutoDetectExportsUntrusted(val); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chose more appropriate names, now that there's a (sandboxed) runtime aspect to our untrusted scanner.
export default cjs;" | ||
var all = cjs.all; | ||
export default cjs; | ||
export { cjs as __moduleExports, all };" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unexpected bug fix ftw!
// Uses VM2 to run safely sandbox untrusted code (no access no Node.js primitives, just JS). | ||
if (isMainEntrypoint && exports.length === 0 && reexports.length === 0) { | ||
const vm = new VM2({wasm: false, fixAsync: false}); | ||
exports = Object.keys( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if module.exports isn't an object? || {}
?
Changes
parse
function not existing.Testing
Docs