Optimisation: Use String instead of window.String. Close gh-1176.

Follows-up 22e28b01e60e87b2454f88ca128fb84916b13564.