(file)
| 1068 | |
| 1069 | var type, refs = []; |
| 1070 | function storeRef(file) { |
| 1071 | return function(node, scopeHere, ancestors) { |
| 1072 | var value = {file: file.name, |
| 1073 | start: outputPos(query, file, node.start), |
| 1074 | end: outputPos(query, file, node.end)}; |
| 1075 | if (isRename) { |
| 1076 | for (var s = scopeHere; s != scope; s = s.prev) { |
| 1077 | var exists = s.hasProp(isRename); |
| 1078 | if (exists) |
| 1079 | throw ternError("Renaming `" + name + "` to `" + isRename + "` would make a variable at line " + |
| 1080 | (asLineChar(file, node.start).line + 1) + " point to the definition at line " + |
| 1081 | (asLineChar(file, exists.name.start).line + 1)); |
| 1082 | } |
| 1083 | var parent = ancestors[ancestors.length - 2]; |
| 1084 | if (parent && parent.type == "Property" && parent.key == parent.value) |
| 1085 | value.isShorthand = true; |
| 1086 | } |
| 1087 | refs.push(value); |
| 1088 | }; |
| 1089 | } |
| 1090 | |
| 1091 | if (scope.originNode) { |
| 1092 | type = "local"; |
no test coverage detected
searching dependent graphs…