From: Feross Aboukhadijeh Date: Fri, 16 Feb 2018 09:27:35 +0000 (-0800) Subject: Fix isInstance() in IE11 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=74bafa34c37708e97b6b14a701c807f09240bb55;p=buffer.git Fix isInstance() in IE11 Confirm that function.name is not undefined --- diff --git a/index.js b/index.js index 0327f29..bedaa69 100644 --- a/index.js +++ b/index.js @@ -1768,7 +1768,8 @@ function blitBuffer (src, dst, offset, length) { // See: https://github.com/feross/buffer/issues/166 function isInstance (obj, type) { return obj instanceof type || - (obj != null && obj.constructor != null && obj.constructor.name === type.name) + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) } function numberIsNaN (obj) { // For IE11 support