underscore
Version:
JavaScript's functional programming helper library.
14 lines (12 loc) • 694 B
JavaScript
import { supportsDataView } from './_setup.js';
import hasObjectTag from './_hasObjectTag.js';
// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
// In IE 11, the most common among them, this problem also applies to
// `Map`, `WeakMap` and `Set`.
// Also, there are cases where an application can override the native
// `DataView` object, in cases like that we can't use the constructor
// safely and should just rely on alternate `DataView` checks
export var hasDataViewBug = (
supportsDataView && (!/\[native code\]/.test(String(DataView)) || hasObjectTag(new DataView(new ArrayBuffer(8))))
),
isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map));