(function() { const env = {"NODE_ENV":"production"}; try { if (process) {
process.env = Object.assign({}, process.env);
Object.assign(process.env, env); return;
}
} catch (e) {} // avoid ReferenceError: process is not defined
globalThis.process = { env:env };
})();
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
function isNodeTest() { return isNode() && process.env.NODE_ENV != "production";
}
let assert; // TODO: try to enable these assertions on mochitest by also enabling it on: // import flags from "devtools/shared/flags"; // if (flags.testing) // Unfortunately it throws a lot on mochitests...
if (isNodeTest()) { assert = function (condition, message) { if (!condition) { thrownew Error(`Assertion failure: ${message}`);
}
};
} else { assert = function () {};
} varassert$1 = assert;
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
if (originalQuery === "") { returnnew RegExp(originalQuery);
}
// Remove the backslashes at the end of the query as it // breaks the RegExp
let query = originalQuery.replace(/\\$/, "");
// If we don't want to do a regexMatch, we need to escape all regex related characters // so they would actually match. if (!regexMatch) {
query = escapeRegExp(query);
}
// ignoreWhiteSpace might return a negative lookbehind, and in such case, we want it // to be consumed as a RegExp part by the callsite, so this needs to be called after // the regexp is escaped. if (ignoreSpaces) {
query = ignoreWhiteSpace(query);
}
function getMatches(query, text, options) { if (!query || !text || !options) { return [];
} const regexQuery = buildQuery(query, options, {
isGlobal: true,
}); const matchedLocations = []; const lines = text.split("\n"); for (let i = 0; i < lines.length; i++) {
let singleMatch; const line = lines[i]; while ((singleMatch = regexQuery.exec(line)) !== null) { // Flow doesn't understand the test above. if (!singleMatch) { thrownew Error("no singleMatch");
}
matchedLocations.push({
line: i,
ch: singleMatch.index,
match: singleMatch[0],
});
// When the match is an empty string the regexQuery.lastIndex will not // change resulting in an infinite loop so we need to check for this and // increment it manually in that case. See issue #7023 if (singleMatch[0] === "") { assert$1(
!regexQuery.unicode, "lastIndex++ can cause issues in unicode mode"
);
regexQuery.lastIndex++;
}
}
} return matchedLocations;
}
function findSourceMatches(content, queryText, options) { if (queryText == "") { return [];
}
const text = content.value; const lines = text.split("\n");
// This is used to find start of a word, so that cropped string look nice const startRegex = /([ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?])/g; // Similarly, find const endRegex = new RegExp(
[ "([ !@#$%^&*()_+-=[]{};':\"\\|,.<>/?])", '[^ !@#$%^&*()_+-=[]{};\':"\\|,.<>/?]*$"/',
].join("")
); // For texts over 100 characters this truncates the text (for display) // around the context of the matched text. function truncateLine(text, column) { if (text.length < 100) { return {
matchIndex: column,
value: text,
};
}
// Initially take 40 chars left to the match const offset = Math.max(column - 40, 0); // 400 characters should be enough to figure out the context of the match const truncStr = text.slice(offset, column + 400);
let start = truncStr.search(startRegex);
let end = truncStr.search(endRegex);
if (start > column) { // No word separator found before the match, so we take all characters // before the match
start = -1;
} if (end < column) {
end = truncStr.length;
} const value = truncStr.slice(start + 1, end);
function requireWorkerUtils () { if (hasRequiredWorkerUtils) return workerUtils.exports;
hasRequiredWorkerUtils = 1;
(function (module) {
class WorkerDispatcher {
#msgId = 1;
#worker = null; // Map of message ids -> promise resolution functions, for dispatching worker responses
#pendingCalls = new Map();
#url = "";
constructor(url) { this.#url = url;
}
start() { // When running in debugger jest test, we don't have access to ChromeWorker if (typeof ChromeWorker == "function") { this.#worker = new ChromeWorker(this.#url);
} else { this.#worker = new Worker(this.#url);
} this.#worker.onerror = err => {
console.error(`Error in worker ${this.#url}`, err.message);
}; this.#worker.addEventListener("message", this.#onMessage);
}
function asErrorMessage(error) { if (typeof error === "object" && error && "message" in error) { // Error can't be sent via postMessage, so be sure to convert to // string. return {
error: true,
message:
error.message +
(error.stack ? "\nStack in the worker:" + error.stack : ""),
metadata: error.metadata,
};
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.