(name, token, scope, overwrites)
| 5080 | } |
| 5081 | |
| 5082 | function functor(name, token, scope, overwrites) { |
| 5083 | var funct = { |
| 5084 | "(name)" : name, |
| 5085 | "(breakage)" : 0, |
| 5086 | "(loopage)" : 0, |
| 5087 | "(scope)" : scope, |
| 5088 | "(tokens)" : {}, |
| 5089 | "(properties)": {}, |
| 5090 | |
| 5091 | "(catch)" : false, |
| 5092 | "(global)" : false, |
| 5093 | |
| 5094 | "(line)" : null, |
| 5095 | "(character)" : null, |
| 5096 | "(metrics)" : null, |
| 5097 | "(statement)" : null, |
| 5098 | "(context)" : null, |
| 5099 | "(blockscope)": null, |
| 5100 | "(comparray)" : null, |
| 5101 | "(generator)" : null, |
| 5102 | "(params)" : null |
| 5103 | }; |
| 5104 | |
| 5105 | if (token) { |
| 5106 | _.extend(funct, { |
| 5107 | "(line)" : token.line, |
| 5108 | "(character)": token.character, |
| 5109 | "(metrics)" : createMetrics(token) |
| 5110 | }); |
| 5111 | } |
| 5112 | |
| 5113 | _.extend(funct, overwrites); |
| 5114 | |
| 5115 | if (funct["(context)"]) { |
| 5116 | funct["(blockscope)"] = funct["(context)"]["(blockscope)"]; |
| 5117 | funct["(comparray)"] = funct["(context)"]["(comparray)"]; |
| 5118 | } |
| 5119 | |
| 5120 | return funct; |
| 5121 | } |
| 5122 | |
| 5123 | function isFunctor(token) { |
| 5124 | return "(scope)" in token; |
no test coverage detected