1 2Array.prototype.LoadArgs = function(args, start, end) { 3 if (typeof(args.length) == 'undefined') { return; } 4 if (isNaN(start)) { start = 0; } 5 if (isNaN(end)) { end = args.length; } 6 for (var i=start; i<end; i++) 7 { 8 this[this.length] = args[i]; 9 } 10} 11 12Array.prototype.Add = function(obj){ 13 this[this.length] = obj; 14} 15 16Array.prototype.AddRange = function(items){ 17 this.push.apply(this, items); 18} 19 20Array.prototype.Clear = function(){ 21 this.length = 0; 22} 23 24Array.prototype.Clone = function(){ 25 if (this.length == 1) 26 { 27 return [this[0]]; 28 } 29 else 30 { 31 return Array.apply(null, this); 32 } 33} 34 35Array.prototype.ForEach = function(func, context) { 36 var args = []; 37 args[0] = null; 38 args[1] = null; 39 args.LoadArgs(arguments, 2); 40 for (var i=0; i < this.length; i++) { 41 var el = this[i]; 42 args[0] = el; 43 args[1] = i 44 if (typeof(el) !== 'undefined') func.apply(context, args); 45 } 46} 47 48Array.prototype.Contains = function(obj) { 49 return (this.IndexOf(obj) >= 0); 50} 51 52 53Array.prototype.IndexOf = function(obj){ 54 for(var i=0; i<this.length; i++) 55 { 56 if(obj == this[i]) return i; 57 } 58 return -1; 59} 60 61Array.prototype.Insert = function(index, item) { 62 this.splice(index, 0, item); 63} 64 65Array.prototype.Remove = function(obj){ 66 var index = this.IndexOf(obj); 67 this.RemoveAt(index); 68} 69 70Array.prototype.RemoveAt = function(index){ 71 if (index >= 0) 72 { 73 if (index < this.length) 74 { 75 this.splice(index, 1); 76 } 77 } 78} 79 80 81 82Function.prototype.Inherits = function(baseClass){ 83 var c = function() {}; 84 c.prototype = baseClass.prototype; 85 this.prototype = new c(); 86 this.prototype.NewBase = baseClass 87 this.prototype.MyBase = baseClass.prototype; 88} 89 90String.prototype.Trim = function(){ 91 return this.replace(/^\s+/, '').replace(/\s+$/, ''); 92} 93 94String.prototype.TrimStart = function(){ 95 return this.replace(/^\s+/, ''); 96} 97 98String.prototype.TrimEnd = function(){ 99 return this.replace(/\s+$/, ''); 100}
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.