1if (!Array.prototype.find) { 2 Object.defineProperty(Array.prototype, 'find', { 3 value: function(predicate) { 4 // 1. Let O be ? ToObject(this value). 5 if (this == null) { 6 throw new TypeError('"this" is null or not defined'); 7 } 8 9 var o = Object(this); 10 11 // 2. Let len be ? ToLength(? Get(O, "length")). 12 var len = o.length >>> 0; 13 14 // 3. If IsCallable(predicate) is false, throw a TypeError exception. 15 if (typeof predicate !== 'function') { 16 throw new TypeError('predicate must be a function'); 17 } 18 19 // 4. If thisArg was supplied, let T be thisArg; else let T be undefined. 20 var thisArg = arguments[1]; 21 22 // 5. Let k be 0. 23 var k = 0; 24 25 // 6. Repeat, while k < len 26 while (k < len) { 27 // a. Let Pk be ! ToString(k). 28 // b. Let kValue be ? Get(O, Pk). 29 // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)). 30 // d. If testResult is true, return kValue. 31 var kValue = o[k]; 32 if (predicate.call(thisArg, kValue, k, o)) { 33 return kValue; 34 } 35 // e. Increase k by 1. 36 k++; 37 } 38 39 // 7. Return undefined. 40 return undefined; 41 } 42 }); 43} 44 45 46if (typeof Object.assign != 'function') { 47 // Must be writable: true, enumerable: false, configurable: true 48 Object.defineProperty(Object, "assign", { 49 value: function assign(target, varArgs) { // .length of function is 2 50 'use strict'; 51 if (target == null) { // TypeError if undefined or null 52 throw new TypeError('Cannot convert undefined or null to object'); 53 } 54 55 var to = Object(target); 56 57 for (var index = 1; index < arguments.length; index++) { 58 var nextSource = arguments[index]; 59 60 if (nextSource != null) { // Skip over if undefined or null 61 for (var nextKey in nextSource) { 62 // Avoid bugs when hasOwnProperty is shadowed 63 if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { 64 to[nextKey] = nextSource[nextKey]; 65 } 66 } 67 } 68 } 69 return to; 70 }, 71 writable: true, 72 configurable: true 73 }); 74}
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.