return array instead of object

pull/7/head
yann300 7 years ago
parent 8351bdf6a5
commit 6866d26561
  1. 4
      src/util/sourceMappingDecoder.js

@ -168,7 +168,7 @@ function findNodeAtSourceLocation (astNodeType, sourceLocation, ast) {
function nodesAtPosition (astNodeType, position, ast) { function nodesAtPosition (astNodeType, position, ast) {
var astWalker = new AstWalker() var astWalker = new AstWalker()
var callback = {} var callback = {}
var found = {} var found = []
callback['*'] = function (node) { callback['*'] = function (node) {
var nodeLocation = sourceLocationFromAstNode(node) var nodeLocation = sourceLocationFromAstNode(node)
if (!nodeLocation) { if (!nodeLocation) {
@ -176,7 +176,7 @@ function nodesAtPosition (astNodeType, position, ast) {
} }
if (nodeLocation.start <= position && nodeLocation.start + nodeLocation.length >= position) { if (nodeLocation.start <= position && nodeLocation.start + nodeLocation.length >= position) {
if (!astNodeType || astNodeType === node.name) { if (!astNodeType || astNodeType === node.name) {
found[node.name] = node found.push(node)
if (astNodeType) return false if (astNodeType) return false
} }
return true return true

Loading…
Cancel
Save