RStudio breaks on FreeBSD: "TypeError: undefined is not an object (evaluating 'window.desktopHooks.notifyRCrashed')"

The executable built by the FreeBSD port prints this message, and doesn't show menus.

I think, it tries to print some error message, but the error procedure itself fails with undefined Java Script object.

Version 1.1.409