B2G/gecko/testing/marionette/marionette-elements.js
/**
  * Add element to list of seen elements
  *
  * @param nsIDOMElement element
  *        The element to add
  *
  * @return string
  *        Returns the server-assigned reference ID
  */
Add element to list of seen elements
@param nsIDOMElement element
The element to add

@return string
Returns the server-assigned reference ID
Add element to list of seen elements @param nsIDOMElement element The element to add @return string Returns the server - assigned reference ID
function EM_addToKnownElements(element) {
    for (let i in this.seenItems) {
      let foundEl = null;
      try {
        foundEl = this.seenItems[i].get();
      }
      catch(e) {}
      if (foundEl) {
        if (XPCNativeWrapper(foundEl) == XPCNativeWrapper(element)) {
          return i;
        }
      }
      else {
        delete this.seenItems[i];
      }
    }
    var id = uuidGen.generateUUID().toString();
    this.seenItems[id] = Components.utils.getWeakReference(element);
    return id;
  }
function EM_addToKnownElements ( element ) { for ( let i in this . seenItems ) { let foundEl = null ; try { foundEl = this . seenItems [ i ] . get ( ) ; } catch ( e ) { } if ( foundEl ) { if ( XPCNativeWrapper ( foundEl ) == XPCNativeWrapper ( element ) ) { return i ; } } else { delete this . seenItems [ i ] ; } } var id = uuidGen . generateUUID ( ) . toString ( ) ; this . seenItems [ id ] = Components . utils . getWeakReference ( element ) ; return id ; }
Add element to list of seen elements
 @param nsIDOMElement element
        The element to add
Add element to list of seen elements @param nsIDOMElement element The element to add
//cleanup reference to GC'd element