1(function () { 2 function isOldIE() { 3 var version = getInternetExplorerVersion(); 4 if (version === -1) { 5 return false; 6 } 7 8 return version < 9; 9 } 10 11 /** 12 * Returns the version of Internet Explorer or a -1 (indicating the use of another browser). 13 * Source: https://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx 14 * @returns {number} the version of Internet Explorer or a -1 (indicating the use of another browser). 15 */ 16 function getInternetExplorerVersion() { 17 var rv = -1; 18 19 if (navigator.appName == 'Microsoft Internet Explorer') { 20 var ua = navigator.userAgent; 21 var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); 22 var res = re.exec(ua); 23 if (res !== null) { 24 rv = parseFloat(res[1]); 25 } 26 } 27 28 return rv; 29 } 30 31 function isDom(obj) { 32 return (typeof obj === "object") && 33 (obj.nodeType === 1) && (typeof obj.style === "object") && 34 (typeof obj.ownerDocument === "object"); 35 } 36 37 if (isOldIE()) { 38 if (Object.videoVastMonkeyPatched) { 39 return; 40 } 41 42 (function () { 43 44 var original = Object.defineProperty; 45 46 Object.defineProperty = function (obj, prop, description) { 47 if (isDom(obj)) { 48 return original(obj, prop, description); 49 } 50 if (description.get || description.set) { 51 throw new Error('browser doesn\'t support getters and setters'); 52 } 53 obj[prop] = description.value; 54 }; 55 56 })(); 57 58 Object.getOwnPropertyNames = function getOwnPropertyNames(object) { 59 var buffer = []; 60 var key; 61 62 // Non-enumerable properties cannot be discovered but can be checked for by name. 63 // Define those used internally by JS to allow an incomplete solution 64 var commonProps = ['length', "name", "arguments", "caller", "prototype", "observe", "unobserve"]; 65 66 if (typeof object === 'undefined' || object === null) { 67 throw new TypeError('Cannot convert undefined or null to object'); 68 } 69 70 object = Object(object); 71 72 // Enumerable properties only 73 for (key in object) { 74 if (Object.prototype.hasOwnProperty.call(object, key)) { 75 buffer.push(key); 76 } 77 } 78 79 // Check for and add the common non-enumerable properties 80 for (var i = 0, s = commonProps.length; i < s; i++) { 81 if (commonProps[i] in object) buffer.push(commonProps[i]); 82 } 83 84 return buffer; 85 }; 86 87 (function () { 88 var original = Object.getOwnPropertyDescriptor; 89 Object.getOwnPropertyDescriptor = function(object, property) { 90 if (isDom(object)) { 91 return original(object, property); 92 }else { 93 return { 94 writable: true, 95 configurable: true, 96 enumerable: false, 97 value: object[property] 98 }; 99 } 100 }; 101 })(); 102 103 104 Object.videoVastMonkeyPatched = true; 105 } 106 107 108 if (typeof Object.create != 'function') { 109 // Production steps of ECMA-262, Edition 5, 15.2.3.5 110 // Reference: http://es5.github.io/#x15.2.3.5 111 Object.create = (function () { 112 // To save on memory, use a shared constructor 113 function Temp() { 114 } 115 116 // make a safe reference to Object.prototype.hasOwnProperty 117 var hasOwn = Object.prototype.hasOwnProperty; 118 119 return function (O) { 120 // 1. If Type(O) is not Object or Null throw a TypeError exception. 121 if (typeof O != 'object') { 122 throw new TypeError('Object prototype may only be an Object or null'); 123 } 124 125 // 2. Let obj be the result of creating a new object as if by the 126 // expression new Object() where Object is the standard built-in 127 // constructor with that name 128 // 3. Set the [[Prototype]] internal property of obj to O. 129 Temp.prototype = O; 130 var obj = new Temp(); 131 Temp.prototype = null; // Let's not keep a stray reference to O... 132 133 // 4. If the argument Properties is present and not undefined, add 134 // own properties to obj as if by calling the standard built-in 135 // function Object.defineProperties with arguments obj and 136 // Properties. 137 if (arguments.length > 1) { 138 // Object.defineProperties does ToObject on its first argument. 139 var Properties = Object(arguments[1]); 140 for (var prop in Properties) { 141 if (hasOwn.call(Properties, prop)) { 142 obj[prop] = Properties[prop]; 143 } 144 } 145 } 146 147 // 5. Return obj 148 return obj; 149 }; 150 })(); 151 } 152 /* jshint ignore:start */
153 if ( typeof Object.getPrototypeOf !== "function" ) { 154 if ( typeof "test".__proto__ === "object" ) { 155 Object.getPrototypeOf = function(object){ 156 return object.__proto__; 157 }; 158 } else { 159 Object.getPrototypeOf = function(object){ 160 // May break if the constructor has been tampered with 161 return object.constructor.prototype; 162 }; 163 } 164 } 165 /* jshint ignore:end */ 166})(); 167
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.