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

Follows-up 22e28b01e60e87b2454f88ca128fb84916b13564.
(cherry picked from commit 31478b90128a60585c087bee57d31148677a99cd)
Whitespace.
(cherry picked from commit b55bfb140f4ccf871a38ec52f21f7ca698515e52)