(file)
| 1003 | |
| 1004 | var type, refs = []; |
| 1005 | function storeRef(file) { |
| 1006 | return function(node, scopeHere, ancestors) { |
| 1007 | var value = {file: file.name, |
| 1008 | start: outputPos(query, file, node.start), |
| 1009 | end: outputPos(query, file, node.end)} |
| 1010 | if (isRename) { |
| 1011 | for (var s = scopeHere; s != scope; s = s.prev) { |
| 1012 | var exists = s.hasProp(isRename); |
| 1013 | if (exists) |
| 1014 | throw ternError("Renaming `" + name + "` to `" + isRename + "` would make a variable at line " + |
| 1015 | (asLineChar(file, node.start).line + 1) + " point to the definition at line " + |
| 1016 | (asLineChar(file, exists.name.start).line + 1)); |
| 1017 | } |
| 1018 | var parent = ancestors[ancestors.length - 2] |
| 1019 | if (parent && parent.type == "Property" && parent.key == parent.value) |
| 1020 | value.isShorthand = true |
| 1021 | } |
| 1022 | refs.push(value); |
| 1023 | }; |
| 1024 | } |
| 1025 | |
| 1026 | if (scope.originNode) { |
| 1027 | type = "local"; |
no test coverage detected