Skip to content

Instantly share code, notes, and snippets.

@ikorchynskyi
ikorchynskyi / dataview-polyfill.js
Created October 1, 2015 09:44
DataView (and ArrayBuffer) polyfill that works in any engine (including old IE).
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 };