Fix potential ReferenceError when testing for the existence of WeakMap.