1 function scriptError(data, dictionary, msg, url, line, col, error, front_end) { 2 3 this._data = data; 4 this._dictionary = dictionary; 5 this._msg = msg; 6 this._url = url; 7 this._line = line; 8 this._col = col; 9 this._error = error; 10 this._function = {}; 11 this._responseText = null; 12 this._front_end = front_end; 13 this._plugin_name = null; 14 15 var locale = 'en_US'; 16 if (data != null && data.locale != null) { 17 18 locale = data.locale; 19 20 } 21 22 if (data.plugin_name != null) { 23 24 this._plugin_name = data.plugin_name; 25 26 } 27 28 this._i18n = new I18n(locale); 29 this._i18n.setDictionary(dictionary); 30 31 } 32 33 scriptError.prototype.setResponseText = function(responseText) { 34 35 this._responseText = responseText; 36 37 } 38 39 scriptError.prototype.getResponseText = function() { 40 41 return this._responseText; 42 43 } 44 45 scriptError.prototype.setFunction = function(object) { 46 47 this._function = object; 48 49 } 50 51 scriptError.prototype.send = function() { 52 53 var object = this; 54 var javascriptFileslist = this._data.javascriptFileslist; 55 if (this._error == null) { 56 57 this._error = {stack: null}; 58 59 } 60 61 var parser = null; 62 var file = ""; 63 if (this._url.length > 0) { 64 65 parser = new URL(this._url); 66 file = parser.pathname.split('/').pop(); 67 var bool = false;
68 for (var i = 0; i < javascriptFileslist.length; i++) { 69 70 if(javascriptFileslist[i] == file){ 71 72 bool = true; 73 break; 74 75 } 76 77 } 78 79 if (bool == false) { 80 81 return {status: "error", message: "no file"}; 82 83 } 84 85 } 86 87 var values = JSON.stringify(this._function.post); 88 89 if (parseInt(this._data.javascriptSyntaxErrorNotification) == 1) { 90 91 var post = { 92 mode: 'scriptError', 93 type: 'JavaScript', 94 file: file, 95 nonce: this._data.nonce, 96 booking_package_nonce: this._data.nonce, 97 action: this._data.action, 98 msg: this._msg, 99 url: this._url, 100 line: this._line, 101 col: this._col, 102 error: this._error.stack, 103 version: window.navigator.appVersion, 104 code: window.navigator.appCodeName, 105 browser: window.navigator.userAgent, 106 name: this._function.name, 107 values: values, 108 page: window.location.href, 109 }; 110 111 if (this._plugin_name != null) { 112 113 post.plugin_name = this._plugin_name; 114 115 } 116 117 var responseText = object.getResponseText(); 118 if (typeof responseText == 'string') { 119 120 post.responseText = responseText; 121 122 } 123 124 fetch(this._url) 125 .then(response => response.text()).then(function (text) { 126 127 var lines = text.split("\n"); 128 post.source = lines[object._line - 1]; 129 console.error(post.source); 130 var xmlHttp = new Booking_App_XMLHttp(object._data.url, post, 0, function(response){ 131 132 object.setResponseText(null); 133 134 }); 135 136 } 137 ); 138 139 140 } else { 141 142 } 143 144 } 145 146
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.