Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
})[0]
row.source = dedup.source
}
var requireCalls = []
var orderOfExecution = new Map()
var ast
// hack to keep track of `module`/`exports` references correctly.
// in node.js they're defined by a function wrapper, so their scope is
// one level higher-ish than the module scope. this emulates that.
var globalScope = {
type: 'BrowserPackFlatWrapper',
parent: null
}
scan.createScope(globalScope, ['require', 'module', 'exports'])
var source = row.source
// Determine if a require() call may not be evaluated according to its linear source position
// This happens primarily if the call is inside a function, or inside a conditional branch
function isOrderUnpredictable (node) {
while ((node = node.parent)) {
// Special-case for IIFE, behaviour is the same as evaluating inline
if (node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression') {
// (() => {})()
if (node.parent && node.parent.type === 'CallExpression' && node.parent.callee === node) {
continue
}
// (function(){}).call(null)
// this form is added by browserify to inject globals
if (node.parent && node.parent.type === 'MemberExpression' &&