[fix] Don't use `new function() return this` to get access to a global

This cause CSP's that don't allow eval to throw errors.

Reported by: @STRML
Reference: 1a31487792965619b1495c94c95112f6a4e2e211