isDataView.js 638 B

1234567891011121314151617
  1. define(['./_tagTester', './isFunction', './isArrayBuffer', './_stringTagBug'], function (_tagTester, isFunction, isArrayBuffer, _stringTagBug) {
  2. var isDataView = _tagTester('DataView');
  3. // In IE 10 - Edge 13, we need a different heuristic
  4. // to determine whether an object is a `DataView`.
  5. // Also, in cases where the native `DataView` is
  6. // overridden we can't rely on the tag itself.
  7. function alternateIsDataView(obj) {
  8. return obj != null && isFunction(obj.getInt8) && isArrayBuffer(obj.buffer);
  9. }
  10. var isDataView$1 = (_stringTagBug.hasDataViewBug ? alternateIsDataView : isDataView);
  11. return isDataView$1;
  12. });