diff --git a/lib/weakmap.js b/lib/weakmap.js index 58cfb7f..3d2f37e 100644 --- a/lib/weakmap.js +++ b/lib/weakmap.js @@ -90,7 +90,7 @@ void function(global, undefined_, undefined){ define(Object, namedFunction('getOwnPropertyNames', function getOwnPropertyNames(obj){ // gh-43 var coercedObj = Object(obj), props; - if (coercedObj.toString() === '[object Window]') { + if ('toString' in coercedObj && coercedObj.toString() === '[object Window]') { try { props = getProps(obj); } catch (e) {