(node)
| 169 | } |
| 170 | |
| 171 | function walk (node) { |
| 172 | if (opts.sourceMap) { |
| 173 | sourcemapper.addSourcemapLocation(node.start); |
| 174 | sourcemapper.addSourcemapLocation(node.end); |
| 175 | } |
| 176 | |
| 177 | var isreq = isRequire(node); |
| 178 | var isreqm = false, isreqv = false, reqid; |
| 179 | if (isreq) { |
| 180 | reqid = node.arguments[0].value; |
| 181 | isreqm = has(modules, reqid); |
| 182 | isreqv = has(varModules, reqid); |
| 183 | } |
| 184 | |
| 185 | if (isreqv && node.parent.type === 'VariableDeclarator' |
| 186 | && node.parent.id.type === 'Identifier') { |
| 187 | var binding = scan.getBinding(node.parent.id); |
| 188 | if (binding) binding.value = varModules[reqid]; |
| 189 | } |
| 190 | else if (isreqv && node.parent.type === 'AssignmentExpression' |
| 191 | && node.parent.left.type === 'Identifier') { |
| 192 | var binding = scan.getBinding(node.parent.left); |
| 193 | if (binding) binding.value = varModules[reqid]; |
| 194 | } |
| 195 | else if (isreqv && node.parent.type === 'MemberExpression' |
| 196 | && isStaticProperty(node.parent.property) |
| 197 | && node.parent.parent.type === 'VariableDeclarator' |
| 198 | && node.parent.parent.id.type === 'Identifier') { |
| 199 | var binding = scan.getBinding(node.parent.parent.id); |
| 200 | var v = varModules[reqid][resolveProperty(node.parent.property)]; |
| 201 | if (binding) binding.value = v; |
| 202 | } |
| 203 | else if (isreqv && node.parent.type === 'MemberExpression' |
| 204 | && node.parent.property.type === 'Identifier') { |
| 205 | //vars[node.parent.parent.id.name] = varModules[reqid]; |
| 206 | } |
| 207 | else if (isreqv && node.parent.type === 'CallExpression') { |
| 208 | // |
| 209 | } |
| 210 | |
| 211 | if (isreqm && node.parent.type === 'VariableDeclarator' |
| 212 | && node.parent.id.type === 'Identifier') { |
| 213 | var binding = scan.getBinding(node.parent.id); |
| 214 | if (binding) { |
| 215 | binding.module = modules[reqid]; |
| 216 | binding.initializer = node.parent; |
| 217 | binding.remove(node.parent.id); |
| 218 | moduleBindings.push(binding); |
| 219 | } |
| 220 | } |
| 221 | else if (isreqm && node.parent.type === 'AssignmentExpression' |
| 222 | && node.parent.left.type === 'Identifier') { |
| 223 | var binding = scan.getBinding(node.parent.left); |
| 224 | if (binding) { |
| 225 | binding.module = modules[reqid]; |
| 226 | binding.initializer = node.parent; |
| 227 | binding.remove(node.parent.left); |
| 228 | moduleBindings.push(binding); |
nothing calls this directly
no test coverage detected
searching dependent graphs…