code: public static Node getRootTarget(Node targetNode) {
      Node enclosingTarget = targetNode;
      for (Node nextTarget = getEnclosingTarget(enclosingTarget);
          nextTarget != null;
          nextTarget = getEnclosingTarget(enclosingTarget)) {
        enclosingTarget = nextTarget;
      }
      return enclosingTarget;
    }
docs: Returns the outermost target enclosing the given assignment target.
  
  <p>Returns targetNode itself if there is no enclosing target.
  
  <p>Examples:
  <pre><code>
  const a = 1; // getRootTarget(a) returns a
  let {[expression]: [x = 3]} = obj; // getRootTarget(x) returns {[expression]: [x = 3]}
  {a = 1} = obj; // getRootTarget(a) returns {a = 1}
  {[expression]: [x = 3]} = obj; // getRootTarget(x) returns {[expression]: [x = 3]}
  function foo({a, b}) {}; // getRootTarget(a) returns {a, b}
  function foo(a = 1) {}; // getRootTarget(a) returns a
  function foo({a, b} = obj) {}; // getRootTarget(a) returns a
  function foo(...a) {}; // getRootTarget(a) returns a
  function foo() {}; // gotRootTarget(foo) returns foo
  class foo {}; // gotRootTarget(foo) returns foo
  import foo from './foo'; // getRootTarget(foo) returns foo
  import {foo} from './foo'; // getRootTarget(foo) returns foo
  import {foo as bar} from './foo'; // getRootTarget(bar) returns bar
  </code></pre>
  
  @param targetNode
  @throws IllegalStateException if targetNode is not actually used as a target