Skip to content

Instantly share code, notes, and snippets.

@lipoiq
lipoiq / dataview-polyfill.js
Created Mar 12, 2016
DataView (and ArrayBuffer) polyfill that works in any engine (including old IE).
View dataview-polyfill.js
void function(global){
if ('DataView' in global && 'ArrayBuffer' in global) {
return;
}
var hide = (function(){
// check if we're in ES5
if (typeof Object.getOwnPropertyNames === 'function' && !('prototype' in Object.getOwnPropertyNames)) {
var hidden = { enumerable: false };