code: func (v *Vars) CloseScope(th *starlark.Thread) {
  	switch {
  	case len(v.scopes) == 0:
  		panic("unexpected CloseScope call without matching OpenScope")
  	case v.scopes[len(v.scopes)-1].thread != th:
  		// This check may fail if Interpreter is using multiple goroutines to
  		// execute 'exec's. It shouldn't. If this ever happens, we'll need to move
  		// 'v.scopes' to Starlark's TLS. OpenScope will need a way to access TLS
  		// of a thread that called 'exec', not only TLS of a new thread, as it does
  		// now.
  		panic("unexpected starlark thread")
  	default:
  		v.scopes = v.scopes[:len(v.scopes)-1]
  	}
  }
docs: // CloseScope discards changes made to variables since the matching OpenScope.