browser-extension.js
function findTypeAt (_file, _pos, expr, type) {
    if (!expr) return type
    var isStringLiteral = expr.node.type === 'Literal' &&
      typeof expr.node.value === 'string'

    if (isStringLiteral) {
      var attr = null
      if (!!expr.node.dom) {
        attr = expr.node.dom
      } else if (!!expr.node.eventType) {
        var eventType = expr.node.eventType
        type = Object.create(type)
        type.doc = eventType['!doc']
        type.url = eventType['!url']        
        type.origin = "browser-extension"
      } else if (expr.node.cssselectors == true) {
        var text = _file.text, wordStart = _pos, wordEnd = _pos
        while (wordStart && acorn.isIdentifierChar(text.charCodeAt(wordStart - 1))) --wordStart
        while (wordEnd < text.length && acorn.isIdentifierChar(text.charCodeAt(wordEnd))) ++wordEnd
        var id = text.slice(wordStart, wordEnd)
        attr = getAttr(expr.node, id)
      }
      if (attr) {
        // The `type` is a value shared for all string literals.
        // We must create a copy before modifying `origin` and `originNode`.
        // Otherwise all string literals would point to the last jump location
        type = Object.create(type)
        type.origin = attr.sourceFile.name
        type.originNode = attr
      }
    }

    return type
  }
function findTypeAt (_file, _pos, expr, type) {
    if (!expr) return type
    var isStringLiteral = expr.node.type === 'Literal' &&
      typeof expr.node.value === 'string'

    if (isStringLiteral) {
      var attr = null
      if (!!expr.node.dom) {
        attr = expr.node.dom
      } else if (!!expr.node.eventType) {
        var eventType = expr.node.eventType
        type = Object.create(type)
        type.doc = eventType['!doc']
        type.url = eventType['!url']        
        type.origin = "browser-extension"
      } else if (expr.node.cssselectors == true) {
        var text = _file.text, wordStart = _pos, wordEnd = _pos
        while (wordStart && acorn.isIdentifierChar(text.charCodeAt(wordStart - 1))) --wordStart
        while (wordEnd < text.length && acorn.isIdentifierChar(text.charCodeAt(wordEnd))) ++wordEnd
        var id = text.slice(wordStart, wordEnd)
        attr = getAttr(expr.node, id)
      }
      if (attr) {
        // The `type` is a value shared for all string literals.
        // We must create a copy before modifying `origin` and `originNode`.
        // Otherwise all string literals would point to the last jump location
        type = Object.create(type)
        type.origin = attr.sourceFile.name
        type.originNode = attr
      }
    }

    return type
  }
function findTypeAt ( _file , _pos , expr , type ) { if ( ! expr ) return type var isStringLiteral = expr . node . type === 'Literal' && typeof expr . node . value === 'string' if ( isStringLiteral ) { var attr = null if ( ! ! expr . node . dom ) { attr = expr . node . dom } else if ( ! ! expr . node . eventType ) { var eventType = expr . node . eventType type = Object . create ( type ) type . doc = eventType [ '!doc' ] type . url = eventType [ '!url' ] type . origin = "browser-extension" } else if ( expr . node . cssselectors == true ) { var text = _file . text , wordStart = _pos , wordEnd = _pos while ( wordStart && acorn . isIdentifierChar ( text . charCodeAt ( wordStart - 1 ) ) ) -- wordStart while ( wordEnd < text . length && acorn . isIdentifierChar ( text . charCodeAt ( wordEnd ) ) ) ++ wordEnd var id = text . slice ( wordStart , wordEnd ) attr = getAttr ( expr . node , id ) } if ( attr ) { // The `type` is a value shared for all string literals. // We must create a copy before modifying `origin` and `originNode`. // Otherwise all string literals would point to the last jump location type = Object . create ( type ) type . origin = attr . sourceFile . name type . originNode = attr } } return type }
Find type at
Find type at