function isFromSeparateExecutionContext(reference) {
	const variable = reference.resolved;
	let scope = reference.from;

	// Scope#variableScope represents execution context
	while (variable.scope.variableScope !== scope.variableScope) {
		if (isClassStaticInitializerScope(scope.variableScope)) {
			scope = scope.variableScope.upper;
		} else {
			return true;
		}
	}

	return false;
}
Checks whether a given reference is evaluated in an execution context
that isn't the one where the variable it refers to is defined.
Execution contexts are:
- top-level
- functions
- class field initializers (implicit functions)
- class static blocks (implicit functions)
Static class field initializers and class static blocks are automatically run during the class definition evaluation,
and therefore we'll consider them as a part of the parent execution context.
Example:

  const x = 1;

  x; // returns `false`
  () => x; // returns `true`

  class C {
      field = x; // returns `true`
      static field = x; // returns `false`

      method() {
          x; // returns `true`
      }

      static method() {
          x; // returns `true`
      }

      static {
          x; // returns `false`
      }
  }
@param {eslint-scope.Reference} reference A reference to check.
@returns {boolean} `true` if the reference is from a separate execution context.