I realized that the refactor to use ReactDebugCurrentFrame as a decoupled stack frame for error messages is not reentrant: https://github.com/facebook/react/pull/10105/files#r127573520

Fiber is not reentrant but other renderers might be. The synchronous server renderer is atm.

We should add tests for warnings between renderers, such as calling a server-render from within a client render, and update the set/reset callsites to use push/pop instead to account for that.

'The `document` global was defined when React was initialized, but is not ' +
            'defined anymore. This can happen in a test environment if a component ' +
            'schedules an update from an asynchronous callback, but the test has already ' +
            'finished running. To solve this, you can either unmount the component at ' +
            'the end of your test (and ensure that any asynchronous operations get ' +
            'canceled in `componentWillUnmount`), or you can change the test itself ' +
            'to be asynchronous.',
        );
      } else {
        expect(fn).not.toThrow();
      }
    } finally {
      
      Object.defineProperty(global, 'document', documentDescriptor);
    }
  });
  it('warns when requestAnimationFrame is not polyfilled', () => {
    const previousRAF = global.requestAnimationFrame;
    try {
      delete global.requestAnimationFrame;
      jest.resetModules();
      expect(() => require('react-dom')).toWarnDev(
        "This browser doesn't support requestAnimationFrame.",
      );
    } finally {
      global.requestAnimationFrame = previousRAF;
    }
  });
});