MCPcopy Create free account
hub / github.com/davidkingzyb/SCAST / analysisD3

Function analysisD3

js/ESTREEJS.js:261–407  ·  view source on GitHub ↗
(node,file)

Source from the content-addressed store, hash-verified

259
260
261 function analysisD3(node,file){
262 node.name=getValue(node)
263 node.poi=loc2poi(node)
264 // console.log('js analysisD3',node.type,node.name,node
265 switch(node.type){
266 case "Program":
267 node.children=node.body
268 break
269 case "Identifier":
270 break
271 case "FunctionDeclaration":
272 node.children=[node.body]
273 break
274 case "FunctionExpression":
275 node.children=[node.body]
276 break
277 case "ArrowFunctionExpression":
278 node.children=[node.body]
279 break
280 case "CallExpression":
281 node.children=node.arguments
282 if(node.callee.type=="FunctionExpression")node.children.push(node.callee)//for self execute function
283 break
284 case "NewExpression":
285 node.children=node.arguments
286 break
287 case "VariableDeclaration":
288 node.children=node.declarations||[]
289 break
290 case "VariableDeclarator":
291 node.children=[node.init]
292 break
293 case "ExpressionStatement":
294 node.children=[node.expression]
295 break
296 case "BlockStatement":
297 node.children=node.body
298 break
299 case "MemberExpression":
300 node.children=[node.object]
301 break
302 case "ReturnStatement":
303 node.children=[node.argument]
304 break
305 case "IfStatement":
306 node.children=[node.consequent||{},node.alternate||{}]
307 break
308 case "SwitchStatement":
309 node.children=node.cases||[]
310 break
311 case "SwitchCase":
312 node.children=node.consequent
313 break
314 case "ThrowStatement":
315 node.children=[node.argument]
316 break
317 case "TryStatement":
318 node.children=[node.block,node.handler,node.finalizer||{}]

Callers

nothing calls this directly

Calls 2

getValueFunction · 0.70
loc2poiFunction · 0.70

Tested by

no test coverage detected