@rstest/core 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +270 -12
- package/dist/0~33.js +12 -6
- package/dist/0~655.js +3 -3
- package/dist/0~816.js +105 -52
- package/dist/0~85.js +0 -1
- package/dist/0~971.js +12 -6
- package/dist/index.js +1846 -32
- package/dist/worker.js +1783 -65
- package/dist-types/index.d.ts +74 -2
- package/dist-types/worker.d.ts +15 -5
- package/package.json +6 -3
- package/dist/0~223.js +0 -158
- package/dist/0~876.js +0 -771
- package/dist/0~908.js +0 -920
- package/dist/0~969.js +0 -1738
package/dist/worker.js
CHANGED
|
@@ -6,12 +6,12 @@ import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__ from "node:fs/
|
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
|
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__ from "node:os";
|
|
8
8
|
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__ from "node:process";
|
|
9
10
|
import * as __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__ from "node:tty";
|
|
10
11
|
import * as __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__ from "node:util";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_v8_d0df5498__ from "node:v8";
|
|
12
|
+
import { pathToFileURL } from "node:url";
|
|
13
|
+
import node_vm from "node:vm";
|
|
14
|
+
import node_v8 from "node:v8";
|
|
15
15
|
var __webpack_modules__ = {
|
|
16
16
|
"../../node_modules/.pnpm/@jest+diff-sequences@30.0.1/node_modules/@jest/diff-sequences/build/index.js": function(module) {
|
|
17
17
|
/*!
|
|
@@ -876,6 +876,36 @@ var __webpack_modules__ = {
|
|
|
876
876
|
get: assembleStyles
|
|
877
877
|
});
|
|
878
878
|
},
|
|
879
|
+
"../../node_modules/.pnpm/buffer-from@1.1.2/node_modules/buffer-from/index.js": function(module) {
|
|
880
|
+
var toString = Object.prototype.toString;
|
|
881
|
+
var isModern = 'undefined' != typeof Buffer && 'function' == typeof Buffer.alloc && 'function' == typeof Buffer.allocUnsafe && 'function' == typeof Buffer.from;
|
|
882
|
+
function isArrayBuffer(input) {
|
|
883
|
+
return 'ArrayBuffer' === toString.call(input).slice(8, -1);
|
|
884
|
+
}
|
|
885
|
+
function fromArrayBuffer(obj, byteOffset, length) {
|
|
886
|
+
byteOffset >>>= 0;
|
|
887
|
+
var maxLength = obj.byteLength - byteOffset;
|
|
888
|
+
if (maxLength < 0) throw new RangeError("'offset' is out of bounds");
|
|
889
|
+
if (void 0 === length) length = maxLength;
|
|
890
|
+
else {
|
|
891
|
+
length >>>= 0;
|
|
892
|
+
if (length > maxLength) throw new RangeError("'length' is out of bounds");
|
|
893
|
+
}
|
|
894
|
+
return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)));
|
|
895
|
+
}
|
|
896
|
+
function fromString(string, encoding) {
|
|
897
|
+
if ('string' != typeof encoding || '' === encoding) encoding = 'utf8';
|
|
898
|
+
if (!Buffer.isEncoding(encoding)) throw new TypeError('"encoding" must be a valid string encoding');
|
|
899
|
+
return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding);
|
|
900
|
+
}
|
|
901
|
+
function bufferFrom(value, encodingOrOffset, length) {
|
|
902
|
+
if ('number' == typeof value) throw new TypeError('"value" argument must not be a number');
|
|
903
|
+
if (isArrayBuffer(value)) return fromArrayBuffer(value, encodingOrOffset, length);
|
|
904
|
+
if ('string' == typeof value) return fromString(value, encodingOrOffset);
|
|
905
|
+
return isModern ? Buffer.from(value) : new Buffer(value);
|
|
906
|
+
}
|
|
907
|
+
module.exports = bufferFrom;
|
|
908
|
+
},
|
|
879
909
|
"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
880
910
|
const ansiStyles = __webpack_require__("../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js");
|
|
881
911
|
const { stdout: stdoutColor, stderr: stderrColor } = __webpack_require__("../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js");
|
|
@@ -4893,6 +4923,1706 @@ var __webpack_modules__ = {
|
|
|
4893
4923
|
if ('production' === process.env.NODE_ENV) module.exports = __webpack_require__("../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/cjs/react-is.production.min.js");
|
|
4894
4924
|
else module.exports = __webpack_require__("../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/cjs/react-is.development.js");
|
|
4895
4925
|
},
|
|
4926
|
+
"../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js": function(module, exports, __webpack_require__) {
|
|
4927
|
+
module = __webpack_require__.nmd(module);
|
|
4928
|
+
var SourceMapConsumer = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js").SourceMapConsumer;
|
|
4929
|
+
var path = __webpack_require__("node:path");
|
|
4930
|
+
var fs;
|
|
4931
|
+
try {
|
|
4932
|
+
fs = __webpack_require__("node:fs");
|
|
4933
|
+
if (!fs.existsSync || !fs.readFileSync) fs = null;
|
|
4934
|
+
} catch (err) {}
|
|
4935
|
+
var bufferFrom = __webpack_require__("../../node_modules/.pnpm/buffer-from@1.1.2/node_modules/buffer-from/index.js");
|
|
4936
|
+
function dynamicRequire(mod, request) {
|
|
4937
|
+
return mod.require(request);
|
|
4938
|
+
}
|
|
4939
|
+
var errorFormatterInstalled = false;
|
|
4940
|
+
var uncaughtShimInstalled = false;
|
|
4941
|
+
var emptyCacheBetweenOperations = false;
|
|
4942
|
+
var environment = "auto";
|
|
4943
|
+
var fileContentsCache = {};
|
|
4944
|
+
var sourceMapCache = {};
|
|
4945
|
+
var reSourceMap = /^data:application\/json[^,]+base64,/;
|
|
4946
|
+
var retrieveFileHandlers = [];
|
|
4947
|
+
var retrieveMapHandlers = [];
|
|
4948
|
+
function isInBrowser() {
|
|
4949
|
+
if ("browser" === environment) return true;
|
|
4950
|
+
if ("node" === environment) return false;
|
|
4951
|
+
return 'undefined' != typeof window && 'function' == typeof XMLHttpRequest && !(window.require && window.module && window.process && "renderer" === window.process.type);
|
|
4952
|
+
}
|
|
4953
|
+
function hasGlobalProcessEventEmitter() {
|
|
4954
|
+
return 'object' == typeof process && null !== process && 'function' == typeof process.on;
|
|
4955
|
+
}
|
|
4956
|
+
function globalProcessVersion() {
|
|
4957
|
+
if ('object' == typeof process && null !== process) return process.version;
|
|
4958
|
+
return '';
|
|
4959
|
+
}
|
|
4960
|
+
function globalProcessStderr() {
|
|
4961
|
+
if ('object' == typeof process && null !== process) return process.stderr;
|
|
4962
|
+
}
|
|
4963
|
+
function globalProcessExit(code) {
|
|
4964
|
+
if ('object' == typeof process && null !== process && 'function' == typeof process.exit) return process.exit(code);
|
|
4965
|
+
}
|
|
4966
|
+
function handlerExec(list) {
|
|
4967
|
+
return function(arg) {
|
|
4968
|
+
for(var i = 0; i < list.length; i++){
|
|
4969
|
+
var ret = list[i](arg);
|
|
4970
|
+
if (ret) return ret;
|
|
4971
|
+
}
|
|
4972
|
+
return null;
|
|
4973
|
+
};
|
|
4974
|
+
}
|
|
4975
|
+
var retrieveFile = handlerExec(retrieveFileHandlers);
|
|
4976
|
+
retrieveFileHandlers.push(function(path) {
|
|
4977
|
+
path = path.trim();
|
|
4978
|
+
if (/^file:/.test(path)) path = path.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
|
|
4979
|
+
return drive ? '' : '/';
|
|
4980
|
+
});
|
|
4981
|
+
if (path in fileContentsCache) return fileContentsCache[path];
|
|
4982
|
+
var contents = '';
|
|
4983
|
+
try {
|
|
4984
|
+
if (fs) {
|
|
4985
|
+
if (fs.existsSync(path)) contents = fs.readFileSync(path, 'utf8');
|
|
4986
|
+
} else {
|
|
4987
|
+
var xhr = new XMLHttpRequest();
|
|
4988
|
+
xhr.open('GET', path, false);
|
|
4989
|
+
xhr.send(null);
|
|
4990
|
+
if (4 === xhr.readyState && 200 === xhr.status) contents = xhr.responseText;
|
|
4991
|
+
}
|
|
4992
|
+
} catch (er) {}
|
|
4993
|
+
return fileContentsCache[path] = contents;
|
|
4994
|
+
});
|
|
4995
|
+
function supportRelativeURL(file, url) {
|
|
4996
|
+
if (!file) return url;
|
|
4997
|
+
var dir = path.dirname(file);
|
|
4998
|
+
var match = /^\w+:\/\/[^\/]*/.exec(dir);
|
|
4999
|
+
var protocol = match ? match[0] : '';
|
|
5000
|
+
var startPath = dir.slice(protocol.length);
|
|
5001
|
+
if (protocol && /^\/\w\:/.test(startPath)) {
|
|
5002
|
+
protocol += '/';
|
|
5003
|
+
return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, '/');
|
|
5004
|
+
}
|
|
5005
|
+
return protocol + path.resolve(dir.slice(protocol.length), url);
|
|
5006
|
+
}
|
|
5007
|
+
function retrieveSourceMapURL(source) {
|
|
5008
|
+
var fileData;
|
|
5009
|
+
if (isInBrowser()) try {
|
|
5010
|
+
var xhr = new XMLHttpRequest();
|
|
5011
|
+
xhr.open('GET', source, false);
|
|
5012
|
+
xhr.send(null);
|
|
5013
|
+
fileData = 4 === xhr.readyState ? xhr.responseText : null;
|
|
5014
|
+
var sourceMapHeader = xhr.getResponseHeader("SourceMap") || xhr.getResponseHeader("X-SourceMap");
|
|
5015
|
+
if (sourceMapHeader) return sourceMapHeader;
|
|
5016
|
+
} catch (e) {}
|
|
5017
|
+
fileData = retrieveFile(source);
|
|
5018
|
+
var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
|
|
5019
|
+
var lastMatch, match;
|
|
5020
|
+
while(match = re.exec(fileData))lastMatch = match;
|
|
5021
|
+
if (!lastMatch) return null;
|
|
5022
|
+
return lastMatch[1];
|
|
5023
|
+
}
|
|
5024
|
+
var retrieveSourceMap = handlerExec(retrieveMapHandlers);
|
|
5025
|
+
retrieveMapHandlers.push(function(source) {
|
|
5026
|
+
var sourceMappingURL = retrieveSourceMapURL(source);
|
|
5027
|
+
if (!sourceMappingURL) return null;
|
|
5028
|
+
var sourceMapData;
|
|
5029
|
+
if (reSourceMap.test(sourceMappingURL)) {
|
|
5030
|
+
var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1);
|
|
5031
|
+
sourceMapData = bufferFrom(rawData, "base64").toString();
|
|
5032
|
+
sourceMappingURL = source;
|
|
5033
|
+
} else {
|
|
5034
|
+
sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
|
|
5035
|
+
sourceMapData = retrieveFile(sourceMappingURL);
|
|
5036
|
+
}
|
|
5037
|
+
if (!sourceMapData) return null;
|
|
5038
|
+
return {
|
|
5039
|
+
url: sourceMappingURL,
|
|
5040
|
+
map: sourceMapData
|
|
5041
|
+
};
|
|
5042
|
+
});
|
|
5043
|
+
function mapSourcePosition(position) {
|
|
5044
|
+
var sourceMap = sourceMapCache[position.source];
|
|
5045
|
+
if (!sourceMap) {
|
|
5046
|
+
var urlAndMap = retrieveSourceMap(position.source);
|
|
5047
|
+
if (urlAndMap) {
|
|
5048
|
+
sourceMap = sourceMapCache[position.source] = {
|
|
5049
|
+
url: urlAndMap.url,
|
|
5050
|
+
map: new SourceMapConsumer(urlAndMap.map)
|
|
5051
|
+
};
|
|
5052
|
+
if (sourceMap.map.sourcesContent) sourceMap.map.sources.forEach(function(source, i) {
|
|
5053
|
+
var contents = sourceMap.map.sourcesContent[i];
|
|
5054
|
+
if (contents) {
|
|
5055
|
+
var url = supportRelativeURL(sourceMap.url, source);
|
|
5056
|
+
fileContentsCache[url] = contents;
|
|
5057
|
+
}
|
|
5058
|
+
});
|
|
5059
|
+
} else sourceMap = sourceMapCache[position.source] = {
|
|
5060
|
+
url: null,
|
|
5061
|
+
map: null
|
|
5062
|
+
};
|
|
5063
|
+
}
|
|
5064
|
+
if (sourceMap && sourceMap.map && 'function' == typeof sourceMap.map.originalPositionFor) {
|
|
5065
|
+
var originalPosition = sourceMap.map.originalPositionFor(position);
|
|
5066
|
+
if (null !== originalPosition.source) {
|
|
5067
|
+
originalPosition.source = supportRelativeURL(sourceMap.url, originalPosition.source);
|
|
5068
|
+
return originalPosition;
|
|
5069
|
+
}
|
|
5070
|
+
}
|
|
5071
|
+
return position;
|
|
5072
|
+
}
|
|
5073
|
+
function mapEvalOrigin(origin) {
|
|
5074
|
+
var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
|
|
5075
|
+
if (match) {
|
|
5076
|
+
var position = mapSourcePosition({
|
|
5077
|
+
source: match[2],
|
|
5078
|
+
line: +match[3],
|
|
5079
|
+
column: match[4] - 1
|
|
5080
|
+
});
|
|
5081
|
+
return 'eval at ' + match[1] + ' (' + position.source + ':' + position.line + ':' + (position.column + 1) + ')';
|
|
5082
|
+
}
|
|
5083
|
+
match = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
|
|
5084
|
+
if (match) return 'eval at ' + match[1] + ' (' + mapEvalOrigin(match[2]) + ')';
|
|
5085
|
+
return origin;
|
|
5086
|
+
}
|
|
5087
|
+
function CallSiteToString() {
|
|
5088
|
+
var fileName;
|
|
5089
|
+
var fileLocation = "";
|
|
5090
|
+
if (this.isNative()) fileLocation = "native";
|
|
5091
|
+
else {
|
|
5092
|
+
fileName = this.getScriptNameOrSourceURL();
|
|
5093
|
+
if (!fileName && this.isEval()) {
|
|
5094
|
+
fileLocation = this.getEvalOrigin();
|
|
5095
|
+
fileLocation += ", ";
|
|
5096
|
+
}
|
|
5097
|
+
if (fileName) fileLocation += fileName;
|
|
5098
|
+
else fileLocation += "<anonymous>";
|
|
5099
|
+
var lineNumber = this.getLineNumber();
|
|
5100
|
+
if (null != lineNumber) {
|
|
5101
|
+
fileLocation += ":" + lineNumber;
|
|
5102
|
+
var columnNumber = this.getColumnNumber();
|
|
5103
|
+
if (columnNumber) fileLocation += ":" + columnNumber;
|
|
5104
|
+
}
|
|
5105
|
+
}
|
|
5106
|
+
var line = "";
|
|
5107
|
+
var functionName = this.getFunctionName();
|
|
5108
|
+
var addSuffix = true;
|
|
5109
|
+
var isConstructor = this.isConstructor();
|
|
5110
|
+
var isMethodCall = !(this.isToplevel() || isConstructor);
|
|
5111
|
+
if (isMethodCall) {
|
|
5112
|
+
var typeName = this.getTypeName();
|
|
5113
|
+
if ("[object Object]" === typeName) typeName = "null";
|
|
5114
|
+
var methodName = this.getMethodName();
|
|
5115
|
+
if (functionName) {
|
|
5116
|
+
if (typeName && 0 != functionName.indexOf(typeName)) line += typeName + ".";
|
|
5117
|
+
line += functionName;
|
|
5118
|
+
if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) line += " [as " + methodName + "]";
|
|
5119
|
+
} else line += typeName + "." + (methodName || "<anonymous>");
|
|
5120
|
+
} else if (isConstructor) line += "new " + (functionName || "<anonymous>");
|
|
5121
|
+
else if (functionName) line += functionName;
|
|
5122
|
+
else {
|
|
5123
|
+
line += fileLocation;
|
|
5124
|
+
addSuffix = false;
|
|
5125
|
+
}
|
|
5126
|
+
if (addSuffix) line += " (" + fileLocation + ")";
|
|
5127
|
+
return line;
|
|
5128
|
+
}
|
|
5129
|
+
function cloneCallSite(frame) {
|
|
5130
|
+
var object = {};
|
|
5131
|
+
Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
|
|
5132
|
+
object[name] = /^(?:is|get)/.test(name) ? function() {
|
|
5133
|
+
return frame[name].call(frame);
|
|
5134
|
+
} : frame[name];
|
|
5135
|
+
});
|
|
5136
|
+
object.toString = CallSiteToString;
|
|
5137
|
+
return object;
|
|
5138
|
+
}
|
|
5139
|
+
function wrapCallSite(frame, state) {
|
|
5140
|
+
if (void 0 === state) state = {
|
|
5141
|
+
nextPosition: null,
|
|
5142
|
+
curPosition: null
|
|
5143
|
+
};
|
|
5144
|
+
if (frame.isNative()) {
|
|
5145
|
+
state.curPosition = null;
|
|
5146
|
+
return frame;
|
|
5147
|
+
}
|
|
5148
|
+
var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
|
|
5149
|
+
if (source) {
|
|
5150
|
+
var line = frame.getLineNumber();
|
|
5151
|
+
var column = frame.getColumnNumber() - 1;
|
|
5152
|
+
var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
|
|
5153
|
+
var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62;
|
|
5154
|
+
if (1 === line && column > headerLength && !isInBrowser() && !frame.isEval()) column -= headerLength;
|
|
5155
|
+
var position = mapSourcePosition({
|
|
5156
|
+
source: source,
|
|
5157
|
+
line: line,
|
|
5158
|
+
column: column
|
|
5159
|
+
});
|
|
5160
|
+
state.curPosition = position;
|
|
5161
|
+
frame = cloneCallSite(frame);
|
|
5162
|
+
var originalFunctionName = frame.getFunctionName;
|
|
5163
|
+
frame.getFunctionName = function() {
|
|
5164
|
+
if (null == state.nextPosition) return originalFunctionName();
|
|
5165
|
+
return state.nextPosition.name || originalFunctionName();
|
|
5166
|
+
};
|
|
5167
|
+
frame.getFileName = function() {
|
|
5168
|
+
return position.source;
|
|
5169
|
+
};
|
|
5170
|
+
frame.getLineNumber = function() {
|
|
5171
|
+
return position.line;
|
|
5172
|
+
};
|
|
5173
|
+
frame.getColumnNumber = function() {
|
|
5174
|
+
return position.column + 1;
|
|
5175
|
+
};
|
|
5176
|
+
frame.getScriptNameOrSourceURL = function() {
|
|
5177
|
+
return position.source;
|
|
5178
|
+
};
|
|
5179
|
+
return frame;
|
|
5180
|
+
}
|
|
5181
|
+
var origin = frame.isEval() && frame.getEvalOrigin();
|
|
5182
|
+
if (origin) {
|
|
5183
|
+
origin = mapEvalOrigin(origin);
|
|
5184
|
+
frame = cloneCallSite(frame);
|
|
5185
|
+
frame.getEvalOrigin = function() {
|
|
5186
|
+
return origin;
|
|
5187
|
+
};
|
|
5188
|
+
}
|
|
5189
|
+
return frame;
|
|
5190
|
+
}
|
|
5191
|
+
function prepareStackTrace(error, stack) {
|
|
5192
|
+
if (emptyCacheBetweenOperations) {
|
|
5193
|
+
fileContentsCache = {};
|
|
5194
|
+
sourceMapCache = {};
|
|
5195
|
+
}
|
|
5196
|
+
var name = error.name || 'Error';
|
|
5197
|
+
var message = error.message || '';
|
|
5198
|
+
var errorString = name + ": " + message;
|
|
5199
|
+
var state = {
|
|
5200
|
+
nextPosition: null,
|
|
5201
|
+
curPosition: null
|
|
5202
|
+
};
|
|
5203
|
+
var processedStack = [];
|
|
5204
|
+
for(var i = stack.length - 1; i >= 0; i--){
|
|
5205
|
+
processedStack.push('\n at ' + wrapCallSite(stack[i], state));
|
|
5206
|
+
state.nextPosition = state.curPosition;
|
|
5207
|
+
}
|
|
5208
|
+
state.curPosition = state.nextPosition = null;
|
|
5209
|
+
return errorString + processedStack.reverse().join('');
|
|
5210
|
+
}
|
|
5211
|
+
function getErrorSource(error) {
|
|
5212
|
+
var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
|
|
5213
|
+
if (match) {
|
|
5214
|
+
var source = match[1];
|
|
5215
|
+
var line = +match[2];
|
|
5216
|
+
var column = +match[3];
|
|
5217
|
+
var contents = fileContentsCache[source];
|
|
5218
|
+
if (!contents && fs && fs.existsSync(source)) try {
|
|
5219
|
+
contents = fs.readFileSync(source, 'utf8');
|
|
5220
|
+
} catch (er) {
|
|
5221
|
+
contents = '';
|
|
5222
|
+
}
|
|
5223
|
+
if (contents) {
|
|
5224
|
+
var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
|
|
5225
|
+
if (code) return source + ':' + line + '\n' + code + '\n' + new Array(column).join(' ') + '^';
|
|
5226
|
+
}
|
|
5227
|
+
}
|
|
5228
|
+
return null;
|
|
5229
|
+
}
|
|
5230
|
+
function printErrorAndExit(error) {
|
|
5231
|
+
var source = getErrorSource(error);
|
|
5232
|
+
var stderr = globalProcessStderr();
|
|
5233
|
+
if (stderr && stderr._handle && stderr._handle.setBlocking) stderr._handle.setBlocking(true);
|
|
5234
|
+
if (source) {
|
|
5235
|
+
console.error();
|
|
5236
|
+
console.error(source);
|
|
5237
|
+
}
|
|
5238
|
+
console.error(error.stack);
|
|
5239
|
+
globalProcessExit(1);
|
|
5240
|
+
}
|
|
5241
|
+
function shimEmitUncaughtException() {
|
|
5242
|
+
var origEmit = process.emit;
|
|
5243
|
+
process.emit = function(type) {
|
|
5244
|
+
if ('uncaughtException' === type) {
|
|
5245
|
+
var hasStack = arguments[1] && arguments[1].stack;
|
|
5246
|
+
var hasListeners = this.listeners(type).length > 0;
|
|
5247
|
+
if (hasStack && !hasListeners) return printErrorAndExit(arguments[1]);
|
|
5248
|
+
}
|
|
5249
|
+
return origEmit.apply(this, arguments);
|
|
5250
|
+
};
|
|
5251
|
+
}
|
|
5252
|
+
var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
|
|
5253
|
+
var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
|
|
5254
|
+
exports.wrapCallSite = wrapCallSite;
|
|
5255
|
+
exports.getErrorSource = getErrorSource;
|
|
5256
|
+
exports.mapSourcePosition = mapSourcePosition;
|
|
5257
|
+
exports.retrieveSourceMap = retrieveSourceMap;
|
|
5258
|
+
exports.install = function(options) {
|
|
5259
|
+
options = options || {};
|
|
5260
|
+
if (options.environment) {
|
|
5261
|
+
environment = options.environment;
|
|
5262
|
+
if (-1 === [
|
|
5263
|
+
"node",
|
|
5264
|
+
"browser",
|
|
5265
|
+
"auto"
|
|
5266
|
+
].indexOf(environment)) throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}");
|
|
5267
|
+
}
|
|
5268
|
+
if (options.retrieveFile) {
|
|
5269
|
+
if (options.overrideRetrieveFile) retrieveFileHandlers.length = 0;
|
|
5270
|
+
retrieveFileHandlers.unshift(options.retrieveFile);
|
|
5271
|
+
}
|
|
5272
|
+
if (options.retrieveSourceMap) {
|
|
5273
|
+
if (options.overrideRetrieveSourceMap) retrieveMapHandlers.length = 0;
|
|
5274
|
+
retrieveMapHandlers.unshift(options.retrieveSourceMap);
|
|
5275
|
+
}
|
|
5276
|
+
if (options.hookRequire && !isInBrowser()) {
|
|
5277
|
+
var Module = dynamicRequire(module, 'module');
|
|
5278
|
+
var $compile = Module.prototype._compile;
|
|
5279
|
+
if (!$compile.__sourceMapSupport) {
|
|
5280
|
+
Module.prototype._compile = function(content, filename) {
|
|
5281
|
+
fileContentsCache[filename] = content;
|
|
5282
|
+
sourceMapCache[filename] = void 0;
|
|
5283
|
+
return $compile.call(this, content, filename);
|
|
5284
|
+
};
|
|
5285
|
+
Module.prototype._compile.__sourceMapSupport = true;
|
|
5286
|
+
}
|
|
5287
|
+
}
|
|
5288
|
+
if (!emptyCacheBetweenOperations) emptyCacheBetweenOperations = 'emptyCacheBetweenOperations' in options ? options.emptyCacheBetweenOperations : false;
|
|
5289
|
+
if (!errorFormatterInstalled) {
|
|
5290
|
+
errorFormatterInstalled = true;
|
|
5291
|
+
Error.prepareStackTrace = prepareStackTrace;
|
|
5292
|
+
}
|
|
5293
|
+
if (!uncaughtShimInstalled) {
|
|
5294
|
+
var installHandler = 'handleUncaughtExceptions' in options ? options.handleUncaughtExceptions : true;
|
|
5295
|
+
try {
|
|
5296
|
+
var worker_threads = dynamicRequire(module, 'worker_threads');
|
|
5297
|
+
if (false === worker_threads.isMainThread) installHandler = false;
|
|
5298
|
+
} catch (e) {}
|
|
5299
|
+
if (installHandler && hasGlobalProcessEventEmitter()) {
|
|
5300
|
+
uncaughtShimInstalled = true;
|
|
5301
|
+
shimEmitUncaughtException();
|
|
5302
|
+
}
|
|
5303
|
+
}
|
|
5304
|
+
};
|
|
5305
|
+
exports.resetRetrieveHandlers = function() {
|
|
5306
|
+
retrieveFileHandlers.length = 0;
|
|
5307
|
+
retrieveMapHandlers.length = 0;
|
|
5308
|
+
retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
|
|
5309
|
+
retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
|
|
5310
|
+
retrieveSourceMap = handlerExec(retrieveMapHandlers);
|
|
5311
|
+
retrieveFile = handlerExec(retrieveFileHandlers);
|
|
5312
|
+
};
|
|
5313
|
+
},
|
|
5314
|
+
"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5315
|
+
var util = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js");
|
|
5316
|
+
var has = Object.prototype.hasOwnProperty;
|
|
5317
|
+
var hasNativeMap = "undefined" != typeof Map;
|
|
5318
|
+
function ArraySet() {
|
|
5319
|
+
this._array = [];
|
|
5320
|
+
this._set = hasNativeMap ? new Map() : Object.create(null);
|
|
5321
|
+
}
|
|
5322
|
+
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
|
5323
|
+
var set = new ArraySet();
|
|
5324
|
+
for(var i = 0, len = aArray.length; i < len; i++)set.add(aArray[i], aAllowDuplicates);
|
|
5325
|
+
return set;
|
|
5326
|
+
};
|
|
5327
|
+
ArraySet.prototype.size = function ArraySet_size() {
|
|
5328
|
+
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
|
5329
|
+
};
|
|
5330
|
+
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
|
|
5331
|
+
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
|
|
5332
|
+
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
|
|
5333
|
+
var idx = this._array.length;
|
|
5334
|
+
if (!isDuplicate || aAllowDuplicates) this._array.push(aStr);
|
|
5335
|
+
if (!isDuplicate) if (hasNativeMap) this._set.set(aStr, idx);
|
|
5336
|
+
else this._set[sStr] = idx;
|
|
5337
|
+
};
|
|
5338
|
+
ArraySet.prototype.has = function ArraySet_has(aStr) {
|
|
5339
|
+
if (hasNativeMap) return this._set.has(aStr);
|
|
5340
|
+
var sStr = util.toSetString(aStr);
|
|
5341
|
+
return has.call(this._set, sStr);
|
|
5342
|
+
};
|
|
5343
|
+
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
|
|
5344
|
+
if (hasNativeMap) {
|
|
5345
|
+
var idx = this._set.get(aStr);
|
|
5346
|
+
if (idx >= 0) return idx;
|
|
5347
|
+
} else {
|
|
5348
|
+
var sStr = util.toSetString(aStr);
|
|
5349
|
+
if (has.call(this._set, sStr)) return this._set[sStr];
|
|
5350
|
+
}
|
|
5351
|
+
throw new Error('"' + aStr + '" is not in the set.');
|
|
5352
|
+
};
|
|
5353
|
+
ArraySet.prototype.at = function ArraySet_at(aIdx) {
|
|
5354
|
+
if (aIdx >= 0 && aIdx < this._array.length) return this._array[aIdx];
|
|
5355
|
+
throw new Error('No element indexed by ' + aIdx);
|
|
5356
|
+
};
|
|
5357
|
+
ArraySet.prototype.toArray = function ArraySet_toArray() {
|
|
5358
|
+
return this._array.slice();
|
|
5359
|
+
};
|
|
5360
|
+
exports.ArraySet = ArraySet;
|
|
5361
|
+
},
|
|
5362
|
+
"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5363
|
+
var base64 = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js");
|
|
5364
|
+
var VLQ_BASE_SHIFT = 5;
|
|
5365
|
+
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
|
5366
|
+
var VLQ_BASE_MASK = VLQ_BASE - 1;
|
|
5367
|
+
var VLQ_CONTINUATION_BIT = VLQ_BASE;
|
|
5368
|
+
function toVLQSigned(aValue) {
|
|
5369
|
+
return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
|
|
5370
|
+
}
|
|
5371
|
+
function fromVLQSigned(aValue) {
|
|
5372
|
+
var isNegative = (1 & aValue) === 1;
|
|
5373
|
+
var shifted = aValue >> 1;
|
|
5374
|
+
return isNegative ? -shifted : shifted;
|
|
5375
|
+
}
|
|
5376
|
+
exports.encode = function base64VLQ_encode(aValue) {
|
|
5377
|
+
var encoded = "";
|
|
5378
|
+
var digit;
|
|
5379
|
+
var vlq = toVLQSigned(aValue);
|
|
5380
|
+
do {
|
|
5381
|
+
digit = vlq & VLQ_BASE_MASK;
|
|
5382
|
+
vlq >>>= VLQ_BASE_SHIFT;
|
|
5383
|
+
if (vlq > 0) digit |= VLQ_CONTINUATION_BIT;
|
|
5384
|
+
encoded += base64.encode(digit);
|
|
5385
|
+
}while (vlq > 0);
|
|
5386
|
+
return encoded;
|
|
5387
|
+
};
|
|
5388
|
+
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
|
5389
|
+
var strLen = aStr.length;
|
|
5390
|
+
var result = 0;
|
|
5391
|
+
var shift = 0;
|
|
5392
|
+
var continuation, digit;
|
|
5393
|
+
do {
|
|
5394
|
+
if (aIndex >= strLen) throw new Error("Expected more digits in base 64 VLQ value.");
|
|
5395
|
+
digit = base64.decode(aStr.charCodeAt(aIndex++));
|
|
5396
|
+
if (-1 === digit) throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
|
|
5397
|
+
continuation = !!(digit & VLQ_CONTINUATION_BIT);
|
|
5398
|
+
digit &= VLQ_BASE_MASK;
|
|
5399
|
+
result += digit << shift;
|
|
5400
|
+
shift += VLQ_BASE_SHIFT;
|
|
5401
|
+
}while (continuation);
|
|
5402
|
+
aOutParam.value = fromVLQSigned(result);
|
|
5403
|
+
aOutParam.rest = aIndex;
|
|
5404
|
+
};
|
|
5405
|
+
},
|
|
5406
|
+
"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js": function(__unused_webpack_module, exports) {
|
|
5407
|
+
var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
|
|
5408
|
+
exports.encode = function(number) {
|
|
5409
|
+
if (0 <= number && number < intToCharMap.length) return intToCharMap[number];
|
|
5410
|
+
throw new TypeError("Must be between 0 and 63: " + number);
|
|
5411
|
+
};
|
|
5412
|
+
exports.decode = function(charCode) {
|
|
5413
|
+
var bigA = 65;
|
|
5414
|
+
var bigZ = 90;
|
|
5415
|
+
var littleA = 97;
|
|
5416
|
+
var littleZ = 122;
|
|
5417
|
+
var zero = 48;
|
|
5418
|
+
var nine = 57;
|
|
5419
|
+
var plus = 43;
|
|
5420
|
+
var slash = 47;
|
|
5421
|
+
var littleOffset = 26;
|
|
5422
|
+
var numberOffset = 52;
|
|
5423
|
+
if (bigA <= charCode && charCode <= bigZ) return charCode - bigA;
|
|
5424
|
+
if (littleA <= charCode && charCode <= littleZ) return charCode - littleA + littleOffset;
|
|
5425
|
+
if (zero <= charCode && charCode <= nine) return charCode - zero + numberOffset;
|
|
5426
|
+
if (charCode == plus) return 62;
|
|
5427
|
+
if (charCode == slash) return 63;
|
|
5428
|
+
return -1;
|
|
5429
|
+
};
|
|
5430
|
+
},
|
|
5431
|
+
"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js": function(__unused_webpack_module, exports) {
|
|
5432
|
+
exports.GREATEST_LOWER_BOUND = 1;
|
|
5433
|
+
exports.LEAST_UPPER_BOUND = 2;
|
|
5434
|
+
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
|
5435
|
+
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
|
5436
|
+
var cmp = aCompare(aNeedle, aHaystack[mid], true);
|
|
5437
|
+
if (0 === cmp) return mid;
|
|
5438
|
+
if (cmp > 0) {
|
|
5439
|
+
if (aHigh - mid > 1) return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
|
|
5440
|
+
if (aBias == exports.LEAST_UPPER_BOUND) return aHigh < aHaystack.length ? aHigh : -1;
|
|
5441
|
+
return mid;
|
|
5442
|
+
}
|
|
5443
|
+
if (mid - aLow > 1) return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
|
|
5444
|
+
if (aBias == exports.LEAST_UPPER_BOUND) return mid;
|
|
5445
|
+
return aLow < 0 ? -1 : aLow;
|
|
5446
|
+
}
|
|
5447
|
+
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
|
5448
|
+
if (0 === aHaystack.length) return -1;
|
|
5449
|
+
var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
|
|
5450
|
+
if (index < 0) return -1;
|
|
5451
|
+
while(index - 1 >= 0){
|
|
5452
|
+
if (0 !== aCompare(aHaystack[index], aHaystack[index - 1], true)) break;
|
|
5453
|
+
--index;
|
|
5454
|
+
}
|
|
5455
|
+
return index;
|
|
5456
|
+
};
|
|
5457
|
+
},
|
|
5458
|
+
"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5459
|
+
var util = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js");
|
|
5460
|
+
function generatedPositionAfter(mappingA, mappingB) {
|
|
5461
|
+
var lineA = mappingA.generatedLine;
|
|
5462
|
+
var lineB = mappingB.generatedLine;
|
|
5463
|
+
var columnA = mappingA.generatedColumn;
|
|
5464
|
+
var columnB = mappingB.generatedColumn;
|
|
5465
|
+
return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
|
|
5466
|
+
}
|
|
5467
|
+
function MappingList() {
|
|
5468
|
+
this._array = [];
|
|
5469
|
+
this._sorted = true;
|
|
5470
|
+
this._last = {
|
|
5471
|
+
generatedLine: -1,
|
|
5472
|
+
generatedColumn: 0
|
|
5473
|
+
};
|
|
5474
|
+
}
|
|
5475
|
+
MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
|
|
5476
|
+
this._array.forEach(aCallback, aThisArg);
|
|
5477
|
+
};
|
|
5478
|
+
MappingList.prototype.add = function MappingList_add(aMapping) {
|
|
5479
|
+
if (generatedPositionAfter(this._last, aMapping)) {
|
|
5480
|
+
this._last = aMapping;
|
|
5481
|
+
this._array.push(aMapping);
|
|
5482
|
+
} else {
|
|
5483
|
+
this._sorted = false;
|
|
5484
|
+
this._array.push(aMapping);
|
|
5485
|
+
}
|
|
5486
|
+
};
|
|
5487
|
+
MappingList.prototype.toArray = function MappingList_toArray() {
|
|
5488
|
+
if (!this._sorted) {
|
|
5489
|
+
this._array.sort(util.compareByGeneratedPositionsInflated);
|
|
5490
|
+
this._sorted = true;
|
|
5491
|
+
}
|
|
5492
|
+
return this._array;
|
|
5493
|
+
};
|
|
5494
|
+
exports.MappingList = MappingList;
|
|
5495
|
+
},
|
|
5496
|
+
"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js": function(__unused_webpack_module, exports) {
|
|
5497
|
+
function swap(ary, x, y) {
|
|
5498
|
+
var temp = ary[x];
|
|
5499
|
+
ary[x] = ary[y];
|
|
5500
|
+
ary[y] = temp;
|
|
5501
|
+
}
|
|
5502
|
+
function randomIntInRange(low, high) {
|
|
5503
|
+
return Math.round(low + Math.random() * (high - low));
|
|
5504
|
+
}
|
|
5505
|
+
function doQuickSort(ary, comparator, p, r) {
|
|
5506
|
+
if (p < r) {
|
|
5507
|
+
var pivotIndex = randomIntInRange(p, r);
|
|
5508
|
+
var i = p - 1;
|
|
5509
|
+
swap(ary, pivotIndex, r);
|
|
5510
|
+
var pivot = ary[r];
|
|
5511
|
+
for(var j = p; j < r; j++)if (comparator(ary[j], pivot) <= 0) {
|
|
5512
|
+
i += 1;
|
|
5513
|
+
swap(ary, i, j);
|
|
5514
|
+
}
|
|
5515
|
+
swap(ary, i + 1, j);
|
|
5516
|
+
var q = i + 1;
|
|
5517
|
+
doQuickSort(ary, comparator, p, q - 1);
|
|
5518
|
+
doQuickSort(ary, comparator, q + 1, r);
|
|
5519
|
+
}
|
|
5520
|
+
}
|
|
5521
|
+
exports.quickSort = function(ary, comparator) {
|
|
5522
|
+
doQuickSort(ary, comparator, 0, ary.length - 1);
|
|
5523
|
+
};
|
|
5524
|
+
},
|
|
5525
|
+
"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
5526
|
+
var util = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js");
|
|
5527
|
+
var binarySearch = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js");
|
|
5528
|
+
var ArraySet = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js").ArraySet;
|
|
5529
|
+
var base64VLQ = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js");
|
|
5530
|
+
var quickSort = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js").quickSort;
|
|
5531
|
+
function SourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
5532
|
+
var sourceMap = aSourceMap;
|
|
5533
|
+
if ('string' == typeof aSourceMap) sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
5534
|
+
return null != sourceMap.sections ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
|
|
5535
|
+
}
|
|
5536
|
+
SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
|
|
5537
|
+
return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
|
|
5538
|
+
};
|
|
5539
|
+
SourceMapConsumer.prototype._version = 3;
|
|
5540
|
+
SourceMapConsumer.prototype.__generatedMappings = null;
|
|
5541
|
+
Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
|
|
5542
|
+
configurable: true,
|
|
5543
|
+
enumerable: true,
|
|
5544
|
+
get: function() {
|
|
5545
|
+
if (!this.__generatedMappings) this._parseMappings(this._mappings, this.sourceRoot);
|
|
5546
|
+
return this.__generatedMappings;
|
|
5547
|
+
}
|
|
5548
|
+
});
|
|
5549
|
+
SourceMapConsumer.prototype.__originalMappings = null;
|
|
5550
|
+
Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
|
|
5551
|
+
configurable: true,
|
|
5552
|
+
enumerable: true,
|
|
5553
|
+
get: function() {
|
|
5554
|
+
if (!this.__originalMappings) this._parseMappings(this._mappings, this.sourceRoot);
|
|
5555
|
+
return this.__originalMappings;
|
|
5556
|
+
}
|
|
5557
|
+
});
|
|
5558
|
+
SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
|
|
5559
|
+
var c = aStr.charAt(index);
|
|
5560
|
+
return ";" === c || "," === c;
|
|
5561
|
+
};
|
|
5562
|
+
SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
|
5563
|
+
throw new Error("Subclasses must implement _parseMappings");
|
|
5564
|
+
};
|
|
5565
|
+
SourceMapConsumer.GENERATED_ORDER = 1;
|
|
5566
|
+
SourceMapConsumer.ORIGINAL_ORDER = 2;
|
|
5567
|
+
SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
|
|
5568
|
+
SourceMapConsumer.LEAST_UPPER_BOUND = 2;
|
|
5569
|
+
SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
|
|
5570
|
+
var context = aContext || null;
|
|
5571
|
+
var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
|
|
5572
|
+
var mappings;
|
|
5573
|
+
switch(order){
|
|
5574
|
+
case SourceMapConsumer.GENERATED_ORDER:
|
|
5575
|
+
mappings = this._generatedMappings;
|
|
5576
|
+
break;
|
|
5577
|
+
case SourceMapConsumer.ORIGINAL_ORDER:
|
|
5578
|
+
mappings = this._originalMappings;
|
|
5579
|
+
break;
|
|
5580
|
+
default:
|
|
5581
|
+
throw new Error("Unknown order of iteration.");
|
|
5582
|
+
}
|
|
5583
|
+
var sourceRoot = this.sourceRoot;
|
|
5584
|
+
mappings.map(function(mapping) {
|
|
5585
|
+
var source = null === mapping.source ? null : this._sources.at(mapping.source);
|
|
5586
|
+
source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
|
|
5587
|
+
return {
|
|
5588
|
+
source: source,
|
|
5589
|
+
generatedLine: mapping.generatedLine,
|
|
5590
|
+
generatedColumn: mapping.generatedColumn,
|
|
5591
|
+
originalLine: mapping.originalLine,
|
|
5592
|
+
originalColumn: mapping.originalColumn,
|
|
5593
|
+
name: null === mapping.name ? null : this._names.at(mapping.name)
|
|
5594
|
+
};
|
|
5595
|
+
}, this).forEach(aCallback, context);
|
|
5596
|
+
};
|
|
5597
|
+
SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
|
|
5598
|
+
var line = util.getArg(aArgs, 'line');
|
|
5599
|
+
var needle = {
|
|
5600
|
+
source: util.getArg(aArgs, 'source'),
|
|
5601
|
+
originalLine: line,
|
|
5602
|
+
originalColumn: util.getArg(aArgs, 'column', 0)
|
|
5603
|
+
};
|
|
5604
|
+
needle.source = this._findSourceIndex(needle.source);
|
|
5605
|
+
if (needle.source < 0) return [];
|
|
5606
|
+
var mappings = [];
|
|
5607
|
+
var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
|
|
5608
|
+
if (index >= 0) {
|
|
5609
|
+
var mapping = this._originalMappings[index];
|
|
5610
|
+
if (void 0 === aArgs.column) {
|
|
5611
|
+
var originalLine = mapping.originalLine;
|
|
5612
|
+
while(mapping && mapping.originalLine === originalLine){
|
|
5613
|
+
mappings.push({
|
|
5614
|
+
line: util.getArg(mapping, 'generatedLine', null),
|
|
5615
|
+
column: util.getArg(mapping, 'generatedColumn', null),
|
|
5616
|
+
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
|
|
5617
|
+
});
|
|
5618
|
+
mapping = this._originalMappings[++index];
|
|
5619
|
+
}
|
|
5620
|
+
} else {
|
|
5621
|
+
var originalColumn = mapping.originalColumn;
|
|
5622
|
+
while(mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn){
|
|
5623
|
+
mappings.push({
|
|
5624
|
+
line: util.getArg(mapping, 'generatedLine', null),
|
|
5625
|
+
column: util.getArg(mapping, 'generatedColumn', null),
|
|
5626
|
+
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
|
|
5627
|
+
});
|
|
5628
|
+
mapping = this._originalMappings[++index];
|
|
5629
|
+
}
|
|
5630
|
+
}
|
|
5631
|
+
}
|
|
5632
|
+
return mappings;
|
|
5633
|
+
};
|
|
5634
|
+
exports.SourceMapConsumer = SourceMapConsumer;
|
|
5635
|
+
function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
5636
|
+
var sourceMap = aSourceMap;
|
|
5637
|
+
if ('string' == typeof aSourceMap) sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
5638
|
+
var version = util.getArg(sourceMap, 'version');
|
|
5639
|
+
var sources = util.getArg(sourceMap, 'sources');
|
|
5640
|
+
var names = util.getArg(sourceMap, 'names', []);
|
|
5641
|
+
var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
|
|
5642
|
+
var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
|
|
5643
|
+
var mappings = util.getArg(sourceMap, 'mappings');
|
|
5644
|
+
var file = util.getArg(sourceMap, 'file', null);
|
|
5645
|
+
if (version != this._version) throw new Error('Unsupported version: ' + version);
|
|
5646
|
+
if (sourceRoot) sourceRoot = util.normalize(sourceRoot);
|
|
5647
|
+
sources = sources.map(String).map(util.normalize).map(function(source) {
|
|
5648
|
+
return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
|
|
5649
|
+
});
|
|
5650
|
+
this._names = ArraySet.fromArray(names.map(String), true);
|
|
5651
|
+
this._sources = ArraySet.fromArray(sources, true);
|
|
5652
|
+
this._absoluteSources = this._sources.toArray().map(function(s) {
|
|
5653
|
+
return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
|
|
5654
|
+
});
|
|
5655
|
+
this.sourceRoot = sourceRoot;
|
|
5656
|
+
this.sourcesContent = sourcesContent;
|
|
5657
|
+
this._mappings = mappings;
|
|
5658
|
+
this._sourceMapURL = aSourceMapURL;
|
|
5659
|
+
this.file = file;
|
|
5660
|
+
}
|
|
5661
|
+
BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
5662
|
+
BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
|
|
5663
|
+
BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
|
|
5664
|
+
var relativeSource = aSource;
|
|
5665
|
+
if (null != this.sourceRoot) relativeSource = util.relative(this.sourceRoot, relativeSource);
|
|
5666
|
+
if (this._sources.has(relativeSource)) return this._sources.indexOf(relativeSource);
|
|
5667
|
+
var i;
|
|
5668
|
+
for(i = 0; i < this._absoluteSources.length; ++i)if (this._absoluteSources[i] == aSource) return i;
|
|
5669
|
+
return -1;
|
|
5670
|
+
};
|
|
5671
|
+
BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
|
|
5672
|
+
var smc = Object.create(BasicSourceMapConsumer.prototype);
|
|
5673
|
+
var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
|
|
5674
|
+
var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
|
|
5675
|
+
smc.sourceRoot = aSourceMap._sourceRoot;
|
|
5676
|
+
smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
|
|
5677
|
+
smc.file = aSourceMap._file;
|
|
5678
|
+
smc._sourceMapURL = aSourceMapURL;
|
|
5679
|
+
smc._absoluteSources = smc._sources.toArray().map(function(s) {
|
|
5680
|
+
return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
|
|
5681
|
+
});
|
|
5682
|
+
var generatedMappings = aSourceMap._mappings.toArray().slice();
|
|
5683
|
+
var destGeneratedMappings = smc.__generatedMappings = [];
|
|
5684
|
+
var destOriginalMappings = smc.__originalMappings = [];
|
|
5685
|
+
for(var i = 0, length = generatedMappings.length; i < length; i++){
|
|
5686
|
+
var srcMapping = generatedMappings[i];
|
|
5687
|
+
var destMapping = new Mapping;
|
|
5688
|
+
destMapping.generatedLine = srcMapping.generatedLine;
|
|
5689
|
+
destMapping.generatedColumn = srcMapping.generatedColumn;
|
|
5690
|
+
if (srcMapping.source) {
|
|
5691
|
+
destMapping.source = sources.indexOf(srcMapping.source);
|
|
5692
|
+
destMapping.originalLine = srcMapping.originalLine;
|
|
5693
|
+
destMapping.originalColumn = srcMapping.originalColumn;
|
|
5694
|
+
if (srcMapping.name) destMapping.name = names.indexOf(srcMapping.name);
|
|
5695
|
+
destOriginalMappings.push(destMapping);
|
|
5696
|
+
}
|
|
5697
|
+
destGeneratedMappings.push(destMapping);
|
|
5698
|
+
}
|
|
5699
|
+
quickSort(smc.__originalMappings, util.compareByOriginalPositions);
|
|
5700
|
+
return smc;
|
|
5701
|
+
};
|
|
5702
|
+
BasicSourceMapConsumer.prototype._version = 3;
|
|
5703
|
+
Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
|
|
5704
|
+
get: function() {
|
|
5705
|
+
return this._absoluteSources.slice();
|
|
5706
|
+
}
|
|
5707
|
+
});
|
|
5708
|
+
function Mapping() {
|
|
5709
|
+
this.generatedLine = 0;
|
|
5710
|
+
this.generatedColumn = 0;
|
|
5711
|
+
this.source = null;
|
|
5712
|
+
this.originalLine = null;
|
|
5713
|
+
this.originalColumn = null;
|
|
5714
|
+
this.name = null;
|
|
5715
|
+
}
|
|
5716
|
+
BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
|
5717
|
+
var generatedLine = 1;
|
|
5718
|
+
var previousGeneratedColumn = 0;
|
|
5719
|
+
var previousOriginalLine = 0;
|
|
5720
|
+
var previousOriginalColumn = 0;
|
|
5721
|
+
var previousSource = 0;
|
|
5722
|
+
var previousName = 0;
|
|
5723
|
+
var length = aStr.length;
|
|
5724
|
+
var index = 0;
|
|
5725
|
+
var cachedSegments = {};
|
|
5726
|
+
var temp = {};
|
|
5727
|
+
var originalMappings = [];
|
|
5728
|
+
var generatedMappings = [];
|
|
5729
|
+
var mapping, str, segment, end, value;
|
|
5730
|
+
while(index < length)if (';' === aStr.charAt(index)) {
|
|
5731
|
+
generatedLine++;
|
|
5732
|
+
index++;
|
|
5733
|
+
previousGeneratedColumn = 0;
|
|
5734
|
+
} else if (',' === aStr.charAt(index)) index++;
|
|
5735
|
+
else {
|
|
5736
|
+
mapping = new Mapping();
|
|
5737
|
+
mapping.generatedLine = generatedLine;
|
|
5738
|
+
for(end = index; end < length && !this._charIsMappingSeparator(aStr, end); end++);
|
|
5739
|
+
str = aStr.slice(index, end);
|
|
5740
|
+
segment = cachedSegments[str];
|
|
5741
|
+
if (segment) index += str.length;
|
|
5742
|
+
else {
|
|
5743
|
+
segment = [];
|
|
5744
|
+
while(index < end){
|
|
5745
|
+
base64VLQ.decode(aStr, index, temp);
|
|
5746
|
+
value = temp.value;
|
|
5747
|
+
index = temp.rest;
|
|
5748
|
+
segment.push(value);
|
|
5749
|
+
}
|
|
5750
|
+
if (2 === segment.length) throw new Error('Found a source, but no line and column');
|
|
5751
|
+
if (3 === segment.length) throw new Error('Found a source and line, but no column');
|
|
5752
|
+
cachedSegments[str] = segment;
|
|
5753
|
+
}
|
|
5754
|
+
mapping.generatedColumn = previousGeneratedColumn + segment[0];
|
|
5755
|
+
previousGeneratedColumn = mapping.generatedColumn;
|
|
5756
|
+
if (segment.length > 1) {
|
|
5757
|
+
mapping.source = previousSource + segment[1];
|
|
5758
|
+
previousSource += segment[1];
|
|
5759
|
+
mapping.originalLine = previousOriginalLine + segment[2];
|
|
5760
|
+
previousOriginalLine = mapping.originalLine;
|
|
5761
|
+
mapping.originalLine += 1;
|
|
5762
|
+
mapping.originalColumn = previousOriginalColumn + segment[3];
|
|
5763
|
+
previousOriginalColumn = mapping.originalColumn;
|
|
5764
|
+
if (segment.length > 4) {
|
|
5765
|
+
mapping.name = previousName + segment[4];
|
|
5766
|
+
previousName += segment[4];
|
|
5767
|
+
}
|
|
5768
|
+
}
|
|
5769
|
+
generatedMappings.push(mapping);
|
|
5770
|
+
if ('number' == typeof mapping.originalLine) originalMappings.push(mapping);
|
|
5771
|
+
}
|
|
5772
|
+
quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
|
|
5773
|
+
this.__generatedMappings = generatedMappings;
|
|
5774
|
+
quickSort(originalMappings, util.compareByOriginalPositions);
|
|
5775
|
+
this.__originalMappings = originalMappings;
|
|
5776
|
+
};
|
|
5777
|
+
BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
|
|
5778
|
+
if (aNeedle[aLineName] <= 0) throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]);
|
|
5779
|
+
if (aNeedle[aColumnName] < 0) throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]);
|
|
5780
|
+
return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
|
|
5781
|
+
};
|
|
5782
|
+
BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
|
|
5783
|
+
for(var index = 0; index < this._generatedMappings.length; ++index){
|
|
5784
|
+
var mapping = this._generatedMappings[index];
|
|
5785
|
+
if (index + 1 < this._generatedMappings.length) {
|
|
5786
|
+
var nextMapping = this._generatedMappings[index + 1];
|
|
5787
|
+
if (mapping.generatedLine === nextMapping.generatedLine) {
|
|
5788
|
+
mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
|
|
5789
|
+
continue;
|
|
5790
|
+
}
|
|
5791
|
+
}
|
|
5792
|
+
mapping.lastGeneratedColumn = 1 / 0;
|
|
5793
|
+
}
|
|
5794
|
+
};
|
|
5795
|
+
BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
|
|
5796
|
+
var needle = {
|
|
5797
|
+
generatedLine: util.getArg(aArgs, 'line'),
|
|
5798
|
+
generatedColumn: util.getArg(aArgs, 'column')
|
|
5799
|
+
};
|
|
5800
|
+
var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND));
|
|
5801
|
+
if (index >= 0) {
|
|
5802
|
+
var mapping = this._generatedMappings[index];
|
|
5803
|
+
if (mapping.generatedLine === needle.generatedLine) {
|
|
5804
|
+
var source = util.getArg(mapping, 'source', null);
|
|
5805
|
+
if (null !== source) {
|
|
5806
|
+
source = this._sources.at(source);
|
|
5807
|
+
source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
|
|
5808
|
+
}
|
|
5809
|
+
var name = util.getArg(mapping, 'name', null);
|
|
5810
|
+
if (null !== name) name = this._names.at(name);
|
|
5811
|
+
return {
|
|
5812
|
+
source: source,
|
|
5813
|
+
line: util.getArg(mapping, 'originalLine', null),
|
|
5814
|
+
column: util.getArg(mapping, 'originalColumn', null),
|
|
5815
|
+
name: name
|
|
5816
|
+
};
|
|
5817
|
+
}
|
|
5818
|
+
}
|
|
5819
|
+
return {
|
|
5820
|
+
source: null,
|
|
5821
|
+
line: null,
|
|
5822
|
+
column: null,
|
|
5823
|
+
name: null
|
|
5824
|
+
};
|
|
5825
|
+
};
|
|
5826
|
+
BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
|
|
5827
|
+
if (!this.sourcesContent) return false;
|
|
5828
|
+
return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
|
|
5829
|
+
return null == sc;
|
|
5830
|
+
});
|
|
5831
|
+
};
|
|
5832
|
+
BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
|
|
5833
|
+
if (!this.sourcesContent) return null;
|
|
5834
|
+
var index = this._findSourceIndex(aSource);
|
|
5835
|
+
if (index >= 0) return this.sourcesContent[index];
|
|
5836
|
+
var relativeSource = aSource;
|
|
5837
|
+
if (null != this.sourceRoot) relativeSource = util.relative(this.sourceRoot, relativeSource);
|
|
5838
|
+
var url;
|
|
5839
|
+
if (null != this.sourceRoot && (url = util.urlParse(this.sourceRoot))) {
|
|
5840
|
+
var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
|
|
5841
|
+
if ("file" == url.scheme && this._sources.has(fileUriAbsPath)) return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
|
|
5842
|
+
if ((!url.path || "/" == url.path) && this._sources.has("/" + relativeSource)) return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
|
|
5843
|
+
}
|
|
5844
|
+
if (nullOnMissing) return null;
|
|
5845
|
+
throw new Error('"' + relativeSource + '" is not in the SourceMap.');
|
|
5846
|
+
};
|
|
5847
|
+
BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
|
|
5848
|
+
var source = util.getArg(aArgs, 'source');
|
|
5849
|
+
source = this._findSourceIndex(source);
|
|
5850
|
+
if (source < 0) return {
|
|
5851
|
+
line: null,
|
|
5852
|
+
column: null,
|
|
5853
|
+
lastColumn: null
|
|
5854
|
+
};
|
|
5855
|
+
var needle = {
|
|
5856
|
+
source: source,
|
|
5857
|
+
originalLine: util.getArg(aArgs, 'line'),
|
|
5858
|
+
originalColumn: util.getArg(aArgs, 'column')
|
|
5859
|
+
};
|
|
5860
|
+
var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND));
|
|
5861
|
+
if (index >= 0) {
|
|
5862
|
+
var mapping = this._originalMappings[index];
|
|
5863
|
+
if (mapping.source === needle.source) return {
|
|
5864
|
+
line: util.getArg(mapping, 'generatedLine', null),
|
|
5865
|
+
column: util.getArg(mapping, 'generatedColumn', null),
|
|
5866
|
+
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
|
|
5867
|
+
};
|
|
5868
|
+
}
|
|
5869
|
+
return {
|
|
5870
|
+
line: null,
|
|
5871
|
+
column: null,
|
|
5872
|
+
lastColumn: null
|
|
5873
|
+
};
|
|
5874
|
+
};
|
|
5875
|
+
function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
5876
|
+
var sourceMap = aSourceMap;
|
|
5877
|
+
if ('string' == typeof aSourceMap) sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
5878
|
+
var version = util.getArg(sourceMap, 'version');
|
|
5879
|
+
var sections = util.getArg(sourceMap, 'sections');
|
|
5880
|
+
if (version != this._version) throw new Error('Unsupported version: ' + version);
|
|
5881
|
+
this._sources = new ArraySet();
|
|
5882
|
+
this._names = new ArraySet();
|
|
5883
|
+
var lastOffset = {
|
|
5884
|
+
line: -1,
|
|
5885
|
+
column: 0
|
|
5886
|
+
};
|
|
5887
|
+
this._sections = sections.map(function(s) {
|
|
5888
|
+
if (s.url) throw new Error('Support for url field in sections not implemented.');
|
|
5889
|
+
var offset = util.getArg(s, 'offset');
|
|
5890
|
+
var offsetLine = util.getArg(offset, 'line');
|
|
5891
|
+
var offsetColumn = util.getArg(offset, 'column');
|
|
5892
|
+
if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) throw new Error('Section offsets must be ordered and non-overlapping.');
|
|
5893
|
+
lastOffset = offset;
|
|
5894
|
+
return {
|
|
5895
|
+
generatedOffset: {
|
|
5896
|
+
generatedLine: offsetLine + 1,
|
|
5897
|
+
generatedColumn: offsetColumn + 1
|
|
5898
|
+
},
|
|
5899
|
+
consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)
|
|
5900
|
+
};
|
|
5901
|
+
});
|
|
5902
|
+
}
|
|
5903
|
+
IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
5904
|
+
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
|
|
5905
|
+
IndexedSourceMapConsumer.prototype._version = 3;
|
|
5906
|
+
Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
|
|
5907
|
+
get: function() {
|
|
5908
|
+
var sources = [];
|
|
5909
|
+
for(var i = 0; i < this._sections.length; i++)for(var j = 0; j < this._sections[i].consumer.sources.length; j++)sources.push(this._sections[i].consumer.sources[j]);
|
|
5910
|
+
return sources;
|
|
5911
|
+
}
|
|
5912
|
+
});
|
|
5913
|
+
IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
|
|
5914
|
+
var needle = {
|
|
5915
|
+
generatedLine: util.getArg(aArgs, 'line'),
|
|
5916
|
+
generatedColumn: util.getArg(aArgs, 'column')
|
|
5917
|
+
};
|
|
5918
|
+
var sectionIndex = binarySearch.search(needle, this._sections, function(needle, section) {
|
|
5919
|
+
var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
|
|
5920
|
+
if (cmp) return cmp;
|
|
5921
|
+
return needle.generatedColumn - section.generatedOffset.generatedColumn;
|
|
5922
|
+
});
|
|
5923
|
+
var section = this._sections[sectionIndex];
|
|
5924
|
+
if (!section) return {
|
|
5925
|
+
source: null,
|
|
5926
|
+
line: null,
|
|
5927
|
+
column: null,
|
|
5928
|
+
name: null
|
|
5929
|
+
};
|
|
5930
|
+
return section.consumer.originalPositionFor({
|
|
5931
|
+
line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
|
|
5932
|
+
column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
5933
|
+
bias: aArgs.bias
|
|
5934
|
+
});
|
|
5935
|
+
};
|
|
5936
|
+
IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
|
|
5937
|
+
return this._sections.every(function(s) {
|
|
5938
|
+
return s.consumer.hasContentsOfAllSources();
|
|
5939
|
+
});
|
|
5940
|
+
};
|
|
5941
|
+
IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
|
|
5942
|
+
for(var i = 0; i < this._sections.length; i++){
|
|
5943
|
+
var section = this._sections[i];
|
|
5944
|
+
var content = section.consumer.sourceContentFor(aSource, true);
|
|
5945
|
+
if (content) return content;
|
|
5946
|
+
}
|
|
5947
|
+
if (nullOnMissing) return null;
|
|
5948
|
+
throw new Error('"' + aSource + '" is not in the SourceMap.');
|
|
5949
|
+
};
|
|
5950
|
+
IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
|
|
5951
|
+
for(var i = 0; i < this._sections.length; i++){
|
|
5952
|
+
var section = this._sections[i];
|
|
5953
|
+
if (-1 !== section.consumer._findSourceIndex(util.getArg(aArgs, 'source'))) {
|
|
5954
|
+
var generatedPosition = section.consumer.generatedPositionFor(aArgs);
|
|
5955
|
+
if (generatedPosition) {
|
|
5956
|
+
var ret = {
|
|
5957
|
+
line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
|
|
5958
|
+
column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
|
|
5959
|
+
};
|
|
5960
|
+
return ret;
|
|
5961
|
+
}
|
|
5962
|
+
}
|
|
5963
|
+
}
|
|
5964
|
+
return {
|
|
5965
|
+
line: null,
|
|
5966
|
+
column: null
|
|
5967
|
+
};
|
|
5968
|
+
};
|
|
5969
|
+
IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
|
5970
|
+
this.__generatedMappings = [];
|
|
5971
|
+
this.__originalMappings = [];
|
|
5972
|
+
for(var i = 0; i < this._sections.length; i++){
|
|
5973
|
+
var section = this._sections[i];
|
|
5974
|
+
var sectionMappings = section.consumer._generatedMappings;
|
|
5975
|
+
for(var j = 0; j < sectionMappings.length; j++){
|
|
5976
|
+
var mapping = sectionMappings[j];
|
|
5977
|
+
var source = section.consumer._sources.at(mapping.source);
|
|
5978
|
+
source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
|
|
5979
|
+
this._sources.add(source);
|
|
5980
|
+
source = this._sources.indexOf(source);
|
|
5981
|
+
var name = null;
|
|
5982
|
+
if (mapping.name) {
|
|
5983
|
+
name = section.consumer._names.at(mapping.name);
|
|
5984
|
+
this._names.add(name);
|
|
5985
|
+
name = this._names.indexOf(name);
|
|
5986
|
+
}
|
|
5987
|
+
var adjustedMapping = {
|
|
5988
|
+
source: source,
|
|
5989
|
+
generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
|
|
5990
|
+
generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
5991
|
+
originalLine: mapping.originalLine,
|
|
5992
|
+
originalColumn: mapping.originalColumn,
|
|
5993
|
+
name: name
|
|
5994
|
+
};
|
|
5995
|
+
this.__generatedMappings.push(adjustedMapping);
|
|
5996
|
+
if ('number' == typeof adjustedMapping.originalLine) this.__originalMappings.push(adjustedMapping);
|
|
5997
|
+
}
|
|
5998
|
+
}
|
|
5999
|
+
quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
|
|
6000
|
+
quickSort(this.__originalMappings, util.compareByOriginalPositions);
|
|
6001
|
+
};
|
|
6002
|
+
},
|
|
6003
|
+
"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6004
|
+
var base64VLQ = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js");
|
|
6005
|
+
var util = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js");
|
|
6006
|
+
var ArraySet = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js").ArraySet;
|
|
6007
|
+
var MappingList = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js").MappingList;
|
|
6008
|
+
function SourceMapGenerator(aArgs) {
|
|
6009
|
+
if (!aArgs) aArgs = {};
|
|
6010
|
+
this._file = util.getArg(aArgs, 'file', null);
|
|
6011
|
+
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
|
|
6012
|
+
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
|
|
6013
|
+
this._sources = new ArraySet();
|
|
6014
|
+
this._names = new ArraySet();
|
|
6015
|
+
this._mappings = new MappingList();
|
|
6016
|
+
this._sourcesContents = null;
|
|
6017
|
+
}
|
|
6018
|
+
SourceMapGenerator.prototype._version = 3;
|
|
6019
|
+
SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
|
|
6020
|
+
var sourceRoot = aSourceMapConsumer.sourceRoot;
|
|
6021
|
+
var generator = new SourceMapGenerator({
|
|
6022
|
+
file: aSourceMapConsumer.file,
|
|
6023
|
+
sourceRoot: sourceRoot
|
|
6024
|
+
});
|
|
6025
|
+
aSourceMapConsumer.eachMapping(function(mapping) {
|
|
6026
|
+
var newMapping = {
|
|
6027
|
+
generated: {
|
|
6028
|
+
line: mapping.generatedLine,
|
|
6029
|
+
column: mapping.generatedColumn
|
|
6030
|
+
}
|
|
6031
|
+
};
|
|
6032
|
+
if (null != mapping.source) {
|
|
6033
|
+
newMapping.source = mapping.source;
|
|
6034
|
+
if (null != sourceRoot) newMapping.source = util.relative(sourceRoot, newMapping.source);
|
|
6035
|
+
newMapping.original = {
|
|
6036
|
+
line: mapping.originalLine,
|
|
6037
|
+
column: mapping.originalColumn
|
|
6038
|
+
};
|
|
6039
|
+
if (null != mapping.name) newMapping.name = mapping.name;
|
|
6040
|
+
}
|
|
6041
|
+
generator.addMapping(newMapping);
|
|
6042
|
+
});
|
|
6043
|
+
aSourceMapConsumer.sources.forEach(function(sourceFile) {
|
|
6044
|
+
var sourceRelative = sourceFile;
|
|
6045
|
+
if (null !== sourceRoot) sourceRelative = util.relative(sourceRoot, sourceFile);
|
|
6046
|
+
if (!generator._sources.has(sourceRelative)) generator._sources.add(sourceRelative);
|
|
6047
|
+
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
|
6048
|
+
if (null != content) generator.setSourceContent(sourceFile, content);
|
|
6049
|
+
});
|
|
6050
|
+
return generator;
|
|
6051
|
+
};
|
|
6052
|
+
SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
|
|
6053
|
+
var generated = util.getArg(aArgs, 'generated');
|
|
6054
|
+
var original = util.getArg(aArgs, 'original', null);
|
|
6055
|
+
var source = util.getArg(aArgs, 'source', null);
|
|
6056
|
+
var name = util.getArg(aArgs, 'name', null);
|
|
6057
|
+
if (!this._skipValidation) this._validateMapping(generated, original, source, name);
|
|
6058
|
+
if (null != source) {
|
|
6059
|
+
source = String(source);
|
|
6060
|
+
if (!this._sources.has(source)) this._sources.add(source);
|
|
6061
|
+
}
|
|
6062
|
+
if (null != name) {
|
|
6063
|
+
name = String(name);
|
|
6064
|
+
if (!this._names.has(name)) this._names.add(name);
|
|
6065
|
+
}
|
|
6066
|
+
this._mappings.add({
|
|
6067
|
+
generatedLine: generated.line,
|
|
6068
|
+
generatedColumn: generated.column,
|
|
6069
|
+
originalLine: null != original && original.line,
|
|
6070
|
+
originalColumn: null != original && original.column,
|
|
6071
|
+
source: source,
|
|
6072
|
+
name: name
|
|
6073
|
+
});
|
|
6074
|
+
};
|
|
6075
|
+
SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
|
6076
|
+
var source = aSourceFile;
|
|
6077
|
+
if (null != this._sourceRoot) source = util.relative(this._sourceRoot, source);
|
|
6078
|
+
if (null != aSourceContent) {
|
|
6079
|
+
if (!this._sourcesContents) this._sourcesContents = Object.create(null);
|
|
6080
|
+
this._sourcesContents[util.toSetString(source)] = aSourceContent;
|
|
6081
|
+
} else if (this._sourcesContents) {
|
|
6082
|
+
delete this._sourcesContents[util.toSetString(source)];
|
|
6083
|
+
if (0 === Object.keys(this._sourcesContents).length) this._sourcesContents = null;
|
|
6084
|
+
}
|
|
6085
|
+
};
|
|
6086
|
+
SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
|
|
6087
|
+
var sourceFile = aSourceFile;
|
|
6088
|
+
if (null == aSourceFile) {
|
|
6089
|
+
if (null == aSourceMapConsumer.file) throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');
|
|
6090
|
+
sourceFile = aSourceMapConsumer.file;
|
|
6091
|
+
}
|
|
6092
|
+
var sourceRoot = this._sourceRoot;
|
|
6093
|
+
if (null != sourceRoot) sourceFile = util.relative(sourceRoot, sourceFile);
|
|
6094
|
+
var newSources = new ArraySet();
|
|
6095
|
+
var newNames = new ArraySet();
|
|
6096
|
+
this._mappings.unsortedForEach(function(mapping) {
|
|
6097
|
+
if (mapping.source === sourceFile && null != mapping.originalLine) {
|
|
6098
|
+
var original = aSourceMapConsumer.originalPositionFor({
|
|
6099
|
+
line: mapping.originalLine,
|
|
6100
|
+
column: mapping.originalColumn
|
|
6101
|
+
});
|
|
6102
|
+
if (null != original.source) {
|
|
6103
|
+
mapping.source = original.source;
|
|
6104
|
+
if (null != aSourceMapPath) mapping.source = util.join(aSourceMapPath, mapping.source);
|
|
6105
|
+
if (null != sourceRoot) mapping.source = util.relative(sourceRoot, mapping.source);
|
|
6106
|
+
mapping.originalLine = original.line;
|
|
6107
|
+
mapping.originalColumn = original.column;
|
|
6108
|
+
if (null != original.name) mapping.name = original.name;
|
|
6109
|
+
}
|
|
6110
|
+
}
|
|
6111
|
+
var source = mapping.source;
|
|
6112
|
+
if (null != source && !newSources.has(source)) newSources.add(source);
|
|
6113
|
+
var name = mapping.name;
|
|
6114
|
+
if (null != name && !newNames.has(name)) newNames.add(name);
|
|
6115
|
+
}, this);
|
|
6116
|
+
this._sources = newSources;
|
|
6117
|
+
this._names = newNames;
|
|
6118
|
+
aSourceMapConsumer.sources.forEach(function(sourceFile) {
|
|
6119
|
+
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
|
6120
|
+
if (null != content) {
|
|
6121
|
+
if (null != aSourceMapPath) sourceFile = util.join(aSourceMapPath, sourceFile);
|
|
6122
|
+
if (null != sourceRoot) sourceFile = util.relative(sourceRoot, sourceFile);
|
|
6123
|
+
this.setSourceContent(sourceFile, content);
|
|
6124
|
+
}
|
|
6125
|
+
}, this);
|
|
6126
|
+
};
|
|
6127
|
+
SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
|
|
6128
|
+
if (aOriginal && 'number' != typeof aOriginal.line && 'number' != typeof aOriginal.column) throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");
|
|
6129
|
+
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) return;
|
|
6130
|
+
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) return;
|
|
6131
|
+
throw new Error('Invalid mapping: ' + JSON.stringify({
|
|
6132
|
+
generated: aGenerated,
|
|
6133
|
+
source: aSource,
|
|
6134
|
+
original: aOriginal,
|
|
6135
|
+
name: aName
|
|
6136
|
+
}));
|
|
6137
|
+
};
|
|
6138
|
+
SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
|
|
6139
|
+
var previousGeneratedColumn = 0;
|
|
6140
|
+
var previousGeneratedLine = 1;
|
|
6141
|
+
var previousOriginalColumn = 0;
|
|
6142
|
+
var previousOriginalLine = 0;
|
|
6143
|
+
var previousName = 0;
|
|
6144
|
+
var previousSource = 0;
|
|
6145
|
+
var result = '';
|
|
6146
|
+
var next;
|
|
6147
|
+
var mapping;
|
|
6148
|
+
var nameIdx;
|
|
6149
|
+
var sourceIdx;
|
|
6150
|
+
var mappings = this._mappings.toArray();
|
|
6151
|
+
for(var i = 0, len = mappings.length; i < len; i++){
|
|
6152
|
+
mapping = mappings[i];
|
|
6153
|
+
next = '';
|
|
6154
|
+
if (mapping.generatedLine !== previousGeneratedLine) {
|
|
6155
|
+
previousGeneratedColumn = 0;
|
|
6156
|
+
while(mapping.generatedLine !== previousGeneratedLine){
|
|
6157
|
+
next += ';';
|
|
6158
|
+
previousGeneratedLine++;
|
|
6159
|
+
}
|
|
6160
|
+
} else if (i > 0) {
|
|
6161
|
+
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) continue;
|
|
6162
|
+
next += ',';
|
|
6163
|
+
}
|
|
6164
|
+
next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
|
|
6165
|
+
previousGeneratedColumn = mapping.generatedColumn;
|
|
6166
|
+
if (null != mapping.source) {
|
|
6167
|
+
sourceIdx = this._sources.indexOf(mapping.source);
|
|
6168
|
+
next += base64VLQ.encode(sourceIdx - previousSource);
|
|
6169
|
+
previousSource = sourceIdx;
|
|
6170
|
+
next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
|
|
6171
|
+
previousOriginalLine = mapping.originalLine - 1;
|
|
6172
|
+
next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
|
|
6173
|
+
previousOriginalColumn = mapping.originalColumn;
|
|
6174
|
+
if (null != mapping.name) {
|
|
6175
|
+
nameIdx = this._names.indexOf(mapping.name);
|
|
6176
|
+
next += base64VLQ.encode(nameIdx - previousName);
|
|
6177
|
+
previousName = nameIdx;
|
|
6178
|
+
}
|
|
6179
|
+
}
|
|
6180
|
+
result += next;
|
|
6181
|
+
}
|
|
6182
|
+
return result;
|
|
6183
|
+
};
|
|
6184
|
+
SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
|
|
6185
|
+
return aSources.map(function(source) {
|
|
6186
|
+
if (!this._sourcesContents) return null;
|
|
6187
|
+
if (null != aSourceRoot) source = util.relative(aSourceRoot, source);
|
|
6188
|
+
var key = util.toSetString(source);
|
|
6189
|
+
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
|
|
6190
|
+
}, this);
|
|
6191
|
+
};
|
|
6192
|
+
SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
|
|
6193
|
+
var map = {
|
|
6194
|
+
version: this._version,
|
|
6195
|
+
sources: this._sources.toArray(),
|
|
6196
|
+
names: this._names.toArray(),
|
|
6197
|
+
mappings: this._serializeMappings()
|
|
6198
|
+
};
|
|
6199
|
+
if (null != this._file) map.file = this._file;
|
|
6200
|
+
if (null != this._sourceRoot) map.sourceRoot = this._sourceRoot;
|
|
6201
|
+
if (this._sourcesContents) map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
|
|
6202
|
+
return map;
|
|
6203
|
+
};
|
|
6204
|
+
SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
|
|
6205
|
+
return JSON.stringify(this.toJSON());
|
|
6206
|
+
};
|
|
6207
|
+
exports.SourceMapGenerator = SourceMapGenerator;
|
|
6208
|
+
},
|
|
6209
|
+
"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6210
|
+
var SourceMapGenerator = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator;
|
|
6211
|
+
var util = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js");
|
|
6212
|
+
var REGEX_NEWLINE = /(\r?\n)/;
|
|
6213
|
+
var NEWLINE_CODE = 10;
|
|
6214
|
+
var isSourceNode = "$$$isSourceNode$$$";
|
|
6215
|
+
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
|
|
6216
|
+
this.children = [];
|
|
6217
|
+
this.sourceContents = {};
|
|
6218
|
+
this.line = null == aLine ? null : aLine;
|
|
6219
|
+
this.column = null == aColumn ? null : aColumn;
|
|
6220
|
+
this.source = null == aSource ? null : aSource;
|
|
6221
|
+
this.name = null == aName ? null : aName;
|
|
6222
|
+
this[isSourceNode] = true;
|
|
6223
|
+
if (null != aChunks) this.add(aChunks);
|
|
6224
|
+
}
|
|
6225
|
+
SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
|
|
6226
|
+
var node = new SourceNode();
|
|
6227
|
+
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
|
|
6228
|
+
var remainingLinesIndex = 0;
|
|
6229
|
+
var shiftNextLine = function() {
|
|
6230
|
+
var lineContents = getNextLine();
|
|
6231
|
+
var newLine = getNextLine() || "";
|
|
6232
|
+
return lineContents + newLine;
|
|
6233
|
+
function getNextLine() {
|
|
6234
|
+
return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
|
|
6235
|
+
}
|
|
6236
|
+
};
|
|
6237
|
+
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
|
|
6238
|
+
var lastMapping = null;
|
|
6239
|
+
aSourceMapConsumer.eachMapping(function(mapping) {
|
|
6240
|
+
if (null !== lastMapping) if (lastGeneratedLine < mapping.generatedLine) {
|
|
6241
|
+
addMappingWithCode(lastMapping, shiftNextLine());
|
|
6242
|
+
lastGeneratedLine++;
|
|
6243
|
+
lastGeneratedColumn = 0;
|
|
6244
|
+
} else {
|
|
6245
|
+
var nextLine = remainingLines[remainingLinesIndex] || '';
|
|
6246
|
+
var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
|
|
6247
|
+
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
|
|
6248
|
+
lastGeneratedColumn = mapping.generatedColumn;
|
|
6249
|
+
addMappingWithCode(lastMapping, code);
|
|
6250
|
+
lastMapping = mapping;
|
|
6251
|
+
return;
|
|
6252
|
+
}
|
|
6253
|
+
while(lastGeneratedLine < mapping.generatedLine){
|
|
6254
|
+
node.add(shiftNextLine());
|
|
6255
|
+
lastGeneratedLine++;
|
|
6256
|
+
}
|
|
6257
|
+
if (lastGeneratedColumn < mapping.generatedColumn) {
|
|
6258
|
+
var nextLine = remainingLines[remainingLinesIndex] || '';
|
|
6259
|
+
node.add(nextLine.substr(0, mapping.generatedColumn));
|
|
6260
|
+
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
|
|
6261
|
+
lastGeneratedColumn = mapping.generatedColumn;
|
|
6262
|
+
}
|
|
6263
|
+
lastMapping = mapping;
|
|
6264
|
+
}, this);
|
|
6265
|
+
if (remainingLinesIndex < remainingLines.length) {
|
|
6266
|
+
if (lastMapping) addMappingWithCode(lastMapping, shiftNextLine());
|
|
6267
|
+
node.add(remainingLines.splice(remainingLinesIndex).join(""));
|
|
6268
|
+
}
|
|
6269
|
+
aSourceMapConsumer.sources.forEach(function(sourceFile) {
|
|
6270
|
+
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
|
6271
|
+
if (null != content) {
|
|
6272
|
+
if (null != aRelativePath) sourceFile = util.join(aRelativePath, sourceFile);
|
|
6273
|
+
node.setSourceContent(sourceFile, content);
|
|
6274
|
+
}
|
|
6275
|
+
});
|
|
6276
|
+
return node;
|
|
6277
|
+
function addMappingWithCode(mapping, code) {
|
|
6278
|
+
if (null === mapping || void 0 === mapping.source) node.add(code);
|
|
6279
|
+
else {
|
|
6280
|
+
var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
|
|
6281
|
+
node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name));
|
|
6282
|
+
}
|
|
6283
|
+
}
|
|
6284
|
+
};
|
|
6285
|
+
SourceNode.prototype.add = function SourceNode_add(aChunk) {
|
|
6286
|
+
if (Array.isArray(aChunk)) aChunk.forEach(function(chunk) {
|
|
6287
|
+
this.add(chunk);
|
|
6288
|
+
}, this);
|
|
6289
|
+
else if (aChunk[isSourceNode] || "string" == typeof aChunk) {
|
|
6290
|
+
if (aChunk) this.children.push(aChunk);
|
|
6291
|
+
} else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
|
|
6292
|
+
return this;
|
|
6293
|
+
};
|
|
6294
|
+
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
|
|
6295
|
+
if (Array.isArray(aChunk)) for(var i = aChunk.length - 1; i >= 0; i--)this.prepend(aChunk[i]);
|
|
6296
|
+
else if (aChunk[isSourceNode] || "string" == typeof aChunk) this.children.unshift(aChunk);
|
|
6297
|
+
else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
|
|
6298
|
+
return this;
|
|
6299
|
+
};
|
|
6300
|
+
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
|
|
6301
|
+
var chunk;
|
|
6302
|
+
for(var i = 0, len = this.children.length; i < len; i++){
|
|
6303
|
+
chunk = this.children[i];
|
|
6304
|
+
if (chunk[isSourceNode]) chunk.walk(aFn);
|
|
6305
|
+
else if ('' !== chunk) aFn(chunk, {
|
|
6306
|
+
source: this.source,
|
|
6307
|
+
line: this.line,
|
|
6308
|
+
column: this.column,
|
|
6309
|
+
name: this.name
|
|
6310
|
+
});
|
|
6311
|
+
}
|
|
6312
|
+
};
|
|
6313
|
+
SourceNode.prototype.join = function SourceNode_join(aSep) {
|
|
6314
|
+
var newChildren;
|
|
6315
|
+
var i;
|
|
6316
|
+
var len = this.children.length;
|
|
6317
|
+
if (len > 0) {
|
|
6318
|
+
newChildren = [];
|
|
6319
|
+
for(i = 0; i < len - 1; i++){
|
|
6320
|
+
newChildren.push(this.children[i]);
|
|
6321
|
+
newChildren.push(aSep);
|
|
6322
|
+
}
|
|
6323
|
+
newChildren.push(this.children[i]);
|
|
6324
|
+
this.children = newChildren;
|
|
6325
|
+
}
|
|
6326
|
+
return this;
|
|
6327
|
+
};
|
|
6328
|
+
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
|
|
6329
|
+
var lastChild = this.children[this.children.length - 1];
|
|
6330
|
+
if (lastChild[isSourceNode]) lastChild.replaceRight(aPattern, aReplacement);
|
|
6331
|
+
else if ('string' == typeof lastChild) this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
|
|
6332
|
+
else this.children.push(''.replace(aPattern, aReplacement));
|
|
6333
|
+
return this;
|
|
6334
|
+
};
|
|
6335
|
+
SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
|
|
6336
|
+
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
|
|
6337
|
+
};
|
|
6338
|
+
SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
|
|
6339
|
+
for(var i = 0, len = this.children.length; i < len; i++)if (this.children[i][isSourceNode]) this.children[i].walkSourceContents(aFn);
|
|
6340
|
+
var sources = Object.keys(this.sourceContents);
|
|
6341
|
+
for(var i = 0, len = sources.length; i < len; i++)aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
|
|
6342
|
+
};
|
|
6343
|
+
SourceNode.prototype.toString = function SourceNode_toString() {
|
|
6344
|
+
var str = "";
|
|
6345
|
+
this.walk(function(chunk) {
|
|
6346
|
+
str += chunk;
|
|
6347
|
+
});
|
|
6348
|
+
return str;
|
|
6349
|
+
};
|
|
6350
|
+
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
|
|
6351
|
+
var generated = {
|
|
6352
|
+
code: "",
|
|
6353
|
+
line: 1,
|
|
6354
|
+
column: 0
|
|
6355
|
+
};
|
|
6356
|
+
var map = new SourceMapGenerator(aArgs);
|
|
6357
|
+
var sourceMappingActive = false;
|
|
6358
|
+
var lastOriginalSource = null;
|
|
6359
|
+
var lastOriginalLine = null;
|
|
6360
|
+
var lastOriginalColumn = null;
|
|
6361
|
+
var lastOriginalName = null;
|
|
6362
|
+
this.walk(function(chunk, original) {
|
|
6363
|
+
generated.code += chunk;
|
|
6364
|
+
if (null !== original.source && null !== original.line && null !== original.column) {
|
|
6365
|
+
if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) map.addMapping({
|
|
6366
|
+
source: original.source,
|
|
6367
|
+
original: {
|
|
6368
|
+
line: original.line,
|
|
6369
|
+
column: original.column
|
|
6370
|
+
},
|
|
6371
|
+
generated: {
|
|
6372
|
+
line: generated.line,
|
|
6373
|
+
column: generated.column
|
|
6374
|
+
},
|
|
6375
|
+
name: original.name
|
|
6376
|
+
});
|
|
6377
|
+
lastOriginalSource = original.source;
|
|
6378
|
+
lastOriginalLine = original.line;
|
|
6379
|
+
lastOriginalColumn = original.column;
|
|
6380
|
+
lastOriginalName = original.name;
|
|
6381
|
+
sourceMappingActive = true;
|
|
6382
|
+
} else if (sourceMappingActive) {
|
|
6383
|
+
map.addMapping({
|
|
6384
|
+
generated: {
|
|
6385
|
+
line: generated.line,
|
|
6386
|
+
column: generated.column
|
|
6387
|
+
}
|
|
6388
|
+
});
|
|
6389
|
+
lastOriginalSource = null;
|
|
6390
|
+
sourceMappingActive = false;
|
|
6391
|
+
}
|
|
6392
|
+
for(var idx = 0, length = chunk.length; idx < length; idx++)if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
|
|
6393
|
+
generated.line++;
|
|
6394
|
+
generated.column = 0;
|
|
6395
|
+
if (idx + 1 === length) {
|
|
6396
|
+
lastOriginalSource = null;
|
|
6397
|
+
sourceMappingActive = false;
|
|
6398
|
+
} else if (sourceMappingActive) map.addMapping({
|
|
6399
|
+
source: original.source,
|
|
6400
|
+
original: {
|
|
6401
|
+
line: original.line,
|
|
6402
|
+
column: original.column
|
|
6403
|
+
},
|
|
6404
|
+
generated: {
|
|
6405
|
+
line: generated.line,
|
|
6406
|
+
column: generated.column
|
|
6407
|
+
},
|
|
6408
|
+
name: original.name
|
|
6409
|
+
});
|
|
6410
|
+
} else generated.column++;
|
|
6411
|
+
});
|
|
6412
|
+
this.walkSourceContents(function(sourceFile, sourceContent) {
|
|
6413
|
+
map.setSourceContent(sourceFile, sourceContent);
|
|
6414
|
+
});
|
|
6415
|
+
return {
|
|
6416
|
+
code: generated.code,
|
|
6417
|
+
map: map
|
|
6418
|
+
};
|
|
6419
|
+
};
|
|
6420
|
+
exports.SourceNode = SourceNode;
|
|
6421
|
+
},
|
|
6422
|
+
"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js": function(__unused_webpack_module, exports) {
|
|
6423
|
+
function getArg(aArgs, aName, aDefaultValue) {
|
|
6424
|
+
if (aName in aArgs) return aArgs[aName];
|
|
6425
|
+
if (3 === arguments.length) return aDefaultValue;
|
|
6426
|
+
throw new Error('"' + aName + '" is a required argument.');
|
|
6427
|
+
}
|
|
6428
|
+
exports.getArg = getArg;
|
|
6429
|
+
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
|
|
6430
|
+
var dataUrlRegexp = /^data:.+\,.+$/;
|
|
6431
|
+
function urlParse(aUrl) {
|
|
6432
|
+
var match = aUrl.match(urlRegexp);
|
|
6433
|
+
if (!match) return null;
|
|
6434
|
+
return {
|
|
6435
|
+
scheme: match[1],
|
|
6436
|
+
auth: match[2],
|
|
6437
|
+
host: match[3],
|
|
6438
|
+
port: match[4],
|
|
6439
|
+
path: match[5]
|
|
6440
|
+
};
|
|
6441
|
+
}
|
|
6442
|
+
exports.urlParse = urlParse;
|
|
6443
|
+
function urlGenerate(aParsedUrl) {
|
|
6444
|
+
var url = '';
|
|
6445
|
+
if (aParsedUrl.scheme) url += aParsedUrl.scheme + ':';
|
|
6446
|
+
url += '//';
|
|
6447
|
+
if (aParsedUrl.auth) url += aParsedUrl.auth + '@';
|
|
6448
|
+
if (aParsedUrl.host) url += aParsedUrl.host;
|
|
6449
|
+
if (aParsedUrl.port) url += ":" + aParsedUrl.port;
|
|
6450
|
+
if (aParsedUrl.path) url += aParsedUrl.path;
|
|
6451
|
+
return url;
|
|
6452
|
+
}
|
|
6453
|
+
exports.urlGenerate = urlGenerate;
|
|
6454
|
+
function normalize(aPath) {
|
|
6455
|
+
var path = aPath;
|
|
6456
|
+
var url = urlParse(aPath);
|
|
6457
|
+
if (url) {
|
|
6458
|
+
if (!url.path) return aPath;
|
|
6459
|
+
path = url.path;
|
|
6460
|
+
}
|
|
6461
|
+
var isAbsolute = exports.isAbsolute(path);
|
|
6462
|
+
var parts = path.split(/\/+/);
|
|
6463
|
+
for(var part, up = 0, i = parts.length - 1; i >= 0; i--){
|
|
6464
|
+
part = parts[i];
|
|
6465
|
+
if ('.' === part) parts.splice(i, 1);
|
|
6466
|
+
else if ('..' === part) up++;
|
|
6467
|
+
else if (up > 0) if ('' === part) {
|
|
6468
|
+
parts.splice(i + 1, up);
|
|
6469
|
+
up = 0;
|
|
6470
|
+
} else {
|
|
6471
|
+
parts.splice(i, 2);
|
|
6472
|
+
up--;
|
|
6473
|
+
}
|
|
6474
|
+
}
|
|
6475
|
+
path = parts.join('/');
|
|
6476
|
+
if ('' === path) path = isAbsolute ? '/' : '.';
|
|
6477
|
+
if (url) {
|
|
6478
|
+
url.path = path;
|
|
6479
|
+
return urlGenerate(url);
|
|
6480
|
+
}
|
|
6481
|
+
return path;
|
|
6482
|
+
}
|
|
6483
|
+
exports.normalize = normalize;
|
|
6484
|
+
function join(aRoot, aPath) {
|
|
6485
|
+
if ("" === aRoot) aRoot = ".";
|
|
6486
|
+
if ("" === aPath) aPath = ".";
|
|
6487
|
+
var aPathUrl = urlParse(aPath);
|
|
6488
|
+
var aRootUrl = urlParse(aRoot);
|
|
6489
|
+
if (aRootUrl) aRoot = aRootUrl.path || '/';
|
|
6490
|
+
if (aPathUrl && !aPathUrl.scheme) {
|
|
6491
|
+
if (aRootUrl) aPathUrl.scheme = aRootUrl.scheme;
|
|
6492
|
+
return urlGenerate(aPathUrl);
|
|
6493
|
+
}
|
|
6494
|
+
if (aPathUrl || aPath.match(dataUrlRegexp)) return aPath;
|
|
6495
|
+
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
|
|
6496
|
+
aRootUrl.host = aPath;
|
|
6497
|
+
return urlGenerate(aRootUrl);
|
|
6498
|
+
}
|
|
6499
|
+
var joined = '/' === aPath.charAt(0) ? aPath : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
|
|
6500
|
+
if (aRootUrl) {
|
|
6501
|
+
aRootUrl.path = joined;
|
|
6502
|
+
return urlGenerate(aRootUrl);
|
|
6503
|
+
}
|
|
6504
|
+
return joined;
|
|
6505
|
+
}
|
|
6506
|
+
exports.join = join;
|
|
6507
|
+
exports.isAbsolute = function(aPath) {
|
|
6508
|
+
return '/' === aPath.charAt(0) || urlRegexp.test(aPath);
|
|
6509
|
+
};
|
|
6510
|
+
function relative(aRoot, aPath) {
|
|
6511
|
+
if ("" === aRoot) aRoot = ".";
|
|
6512
|
+
aRoot = aRoot.replace(/\/$/, '');
|
|
6513
|
+
var level = 0;
|
|
6514
|
+
while(0 !== aPath.indexOf(aRoot + '/')){
|
|
6515
|
+
var index = aRoot.lastIndexOf("/");
|
|
6516
|
+
if (index < 0) return aPath;
|
|
6517
|
+
aRoot = aRoot.slice(0, index);
|
|
6518
|
+
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) return aPath;
|
|
6519
|
+
++level;
|
|
6520
|
+
}
|
|
6521
|
+
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
|
6522
|
+
}
|
|
6523
|
+
exports.relative = relative;
|
|
6524
|
+
var supportsNullProto = function() {
|
|
6525
|
+
var obj = Object.create(null);
|
|
6526
|
+
return !('__proto__' in obj);
|
|
6527
|
+
}();
|
|
6528
|
+
function identity(s) {
|
|
6529
|
+
return s;
|
|
6530
|
+
}
|
|
6531
|
+
function toSetString(aStr) {
|
|
6532
|
+
if (isProtoString(aStr)) return '$' + aStr;
|
|
6533
|
+
return aStr;
|
|
6534
|
+
}
|
|
6535
|
+
exports.toSetString = supportsNullProto ? identity : toSetString;
|
|
6536
|
+
function fromSetString(aStr) {
|
|
6537
|
+
if (isProtoString(aStr)) return aStr.slice(1);
|
|
6538
|
+
return aStr;
|
|
6539
|
+
}
|
|
6540
|
+
exports.fromSetString = supportsNullProto ? identity : fromSetString;
|
|
6541
|
+
function isProtoString(s) {
|
|
6542
|
+
if (!s) return false;
|
|
6543
|
+
var length = s.length;
|
|
6544
|
+
if (length < 9) return false;
|
|
6545
|
+
if (95 !== s.charCodeAt(length - 1) || 95 !== s.charCodeAt(length - 2) || 111 !== s.charCodeAt(length - 3) || 116 !== s.charCodeAt(length - 4) || 111 !== s.charCodeAt(length - 5) || 114 !== s.charCodeAt(length - 6) || 112 !== s.charCodeAt(length - 7) || 95 !== s.charCodeAt(length - 8) || 95 !== s.charCodeAt(length - 9)) return false;
|
|
6546
|
+
for(var i = length - 10; i >= 0; i--)if (36 !== s.charCodeAt(i)) return false;
|
|
6547
|
+
return true;
|
|
6548
|
+
}
|
|
6549
|
+
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
|
6550
|
+
var cmp = strcmp(mappingA.source, mappingB.source);
|
|
6551
|
+
if (0 !== cmp) return cmp;
|
|
6552
|
+
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
6553
|
+
if (0 !== cmp) return cmp;
|
|
6554
|
+
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
6555
|
+
if (0 !== cmp || onlyCompareOriginal) return cmp;
|
|
6556
|
+
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
6557
|
+
if (0 !== cmp) return cmp;
|
|
6558
|
+
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
6559
|
+
if (0 !== cmp) return cmp;
|
|
6560
|
+
return strcmp(mappingA.name, mappingB.name);
|
|
6561
|
+
}
|
|
6562
|
+
exports.compareByOriginalPositions = compareByOriginalPositions;
|
|
6563
|
+
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
|
|
6564
|
+
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
6565
|
+
if (0 !== cmp) return cmp;
|
|
6566
|
+
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
6567
|
+
if (0 !== cmp || onlyCompareGenerated) return cmp;
|
|
6568
|
+
cmp = strcmp(mappingA.source, mappingB.source);
|
|
6569
|
+
if (0 !== cmp) return cmp;
|
|
6570
|
+
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
6571
|
+
if (0 !== cmp) return cmp;
|
|
6572
|
+
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
6573
|
+
if (0 !== cmp) return cmp;
|
|
6574
|
+
return strcmp(mappingA.name, mappingB.name);
|
|
6575
|
+
}
|
|
6576
|
+
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
|
|
6577
|
+
function strcmp(aStr1, aStr2) {
|
|
6578
|
+
if (aStr1 === aStr2) return 0;
|
|
6579
|
+
if (null === aStr1) return 1;
|
|
6580
|
+
if (null === aStr2) return -1;
|
|
6581
|
+
if (aStr1 > aStr2) return 1;
|
|
6582
|
+
return -1;
|
|
6583
|
+
}
|
|
6584
|
+
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
|
6585
|
+
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
6586
|
+
if (0 !== cmp) return cmp;
|
|
6587
|
+
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
6588
|
+
if (0 !== cmp) return cmp;
|
|
6589
|
+
cmp = strcmp(mappingA.source, mappingB.source);
|
|
6590
|
+
if (0 !== cmp) return cmp;
|
|
6591
|
+
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
6592
|
+
if (0 !== cmp) return cmp;
|
|
6593
|
+
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
6594
|
+
if (0 !== cmp) return cmp;
|
|
6595
|
+
return strcmp(mappingA.name, mappingB.name);
|
|
6596
|
+
}
|
|
6597
|
+
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
|
|
6598
|
+
function parseSourceMapInput(str) {
|
|
6599
|
+
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
|
|
6600
|
+
}
|
|
6601
|
+
exports.parseSourceMapInput = parseSourceMapInput;
|
|
6602
|
+
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
|
|
6603
|
+
sourceURL = sourceURL || '';
|
|
6604
|
+
if (sourceRoot) {
|
|
6605
|
+
if ('/' !== sourceRoot[sourceRoot.length - 1] && '/' !== sourceURL[0]) sourceRoot += '/';
|
|
6606
|
+
sourceURL = sourceRoot + sourceURL;
|
|
6607
|
+
}
|
|
6608
|
+
if (sourceMapURL) {
|
|
6609
|
+
var parsed = urlParse(sourceMapURL);
|
|
6610
|
+
if (!parsed) throw new Error("sourceMapURL could not be parsed");
|
|
6611
|
+
if (parsed.path) {
|
|
6612
|
+
var index = parsed.path.lastIndexOf('/');
|
|
6613
|
+
if (index >= 0) parsed.path = parsed.path.substring(0, index + 1);
|
|
6614
|
+
}
|
|
6615
|
+
sourceURL = join(urlGenerate(parsed), sourceURL);
|
|
6616
|
+
}
|
|
6617
|
+
return normalize(sourceURL);
|
|
6618
|
+
}
|
|
6619
|
+
exports.computeSourceURL = computeSourceURL;
|
|
6620
|
+
},
|
|
6621
|
+
"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6622
|
+
__webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js").SourceMapGenerator;
|
|
6623
|
+
exports.SourceMapConsumer = __webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js").SourceMapConsumer;
|
|
6624
|
+
__webpack_require__("../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js").SourceNode;
|
|
6625
|
+
},
|
|
4896
6626
|
"../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
4897
6627
|
const os = __webpack_require__("node:os");
|
|
4898
6628
|
const tty = __webpack_require__("node:tty");
|
|
@@ -4991,7 +6721,10 @@ var __webpack_modules__ = {
|
|
|
4991
6721
|
const errors = Array.isArray(err) ? err : [
|
|
4992
6722
|
err
|
|
4993
6723
|
];
|
|
4994
|
-
return errors.map((
|
|
6724
|
+
return errors.map((rawError)=>{
|
|
6725
|
+
const error = 'string' == typeof rawError ? {
|
|
6726
|
+
message: rawError
|
|
6727
|
+
} : rawError;
|
|
4995
6728
|
const errObj = {
|
|
4996
6729
|
...error,
|
|
4997
6730
|
message: error.message,
|
|
@@ -5061,8 +6794,10 @@ var __webpack_modules__ = {
|
|
|
5061
6794
|
"./src/utils/constants.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
5062
6795
|
__webpack_require__.d(__webpack_exports__, {
|
|
5063
6796
|
TE: ()=>globalApis,
|
|
5064
|
-
q_: ()=>ROOT_SUITE_NAME
|
|
6797
|
+
q_: ()=>ROOT_SUITE_NAME,
|
|
6798
|
+
vO: ()=>TEST_DELIMITER
|
|
5065
6799
|
});
|
|
6800
|
+
const TEST_DELIMITER = '>';
|
|
5066
6801
|
const ROOT_SUITE_NAME = 'Rstest:_internal_root_suite';
|
|
5067
6802
|
const globalApis = [
|
|
5068
6803
|
'test',
|
|
@@ -5091,7 +6826,7 @@ var __webpack_modules__ = {
|
|
|
5091
6826
|
});
|
|
5092
6827
|
var picocolors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
5093
6828
|
var picocolors__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/ __webpack_require__.n(picocolors__WEBPACK_IMPORTED_MODULE_1__);
|
|
5094
|
-
__webpack_require__("./src/utils/constants.ts");
|
|
6829
|
+
var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./src/utils/constants.ts");
|
|
5095
6830
|
const isObject = (obj)=>'[object Object]' === Object.prototype.toString.call(obj);
|
|
5096
6831
|
const castArray = (arr)=>{
|
|
5097
6832
|
if (void 0 === arr) return [];
|
|
@@ -5118,7 +6853,7 @@ var __webpack_modules__ = {
|
|
|
5118
6853
|
return time;
|
|
5119
6854
|
};
|
|
5120
6855
|
const getTaskNames = (test)=>(test.parentNames || []).concat(test.name).filter(Boolean);
|
|
5121
|
-
const getTaskNameWithPrefix = (test, delimiter =
|
|
6856
|
+
const getTaskNameWithPrefix = (test, delimiter = _constants__WEBPACK_IMPORTED_MODULE_0__.vO)=>getTaskNames(test).join(` ${delimiter} `);
|
|
5122
6857
|
const REGEXP_FLAG_PREFIX = 'RSTEST_REGEXP:';
|
|
5123
6858
|
const unwrapRegex = (value)=>{
|
|
5124
6859
|
if (value.startsWith(REGEXP_FLAG_PREFIX)) {
|
|
@@ -5159,15 +6894,16 @@ var __webpack_modules__ = {
|
|
|
5159
6894
|
__webpack_require__.d(__webpack_exports__, {
|
|
5160
6895
|
vF: ()=>src_logger
|
|
5161
6896
|
});
|
|
6897
|
+
var external_node_process_ = __webpack_require__("node:process");
|
|
5162
6898
|
var external_node_os_ = __webpack_require__("node:os");
|
|
5163
6899
|
var external_node_tty_ = __webpack_require__("node:tty");
|
|
5164
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
6900
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : external_node_process_["default"].argv) {
|
|
5165
6901
|
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
5166
6902
|
const position = argv.indexOf(prefix + flag);
|
|
5167
6903
|
const terminatorPosition = argv.indexOf('--');
|
|
5168
6904
|
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
5169
6905
|
}
|
|
5170
|
-
const { env } =
|
|
6906
|
+
const { env } = external_node_process_["default"];
|
|
5171
6907
|
let flagForceColor;
|
|
5172
6908
|
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
|
|
5173
6909
|
else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
|
|
@@ -5207,7 +6943,7 @@ var __webpack_modules__ = {
|
|
|
5207
6943
|
if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
|
|
5208
6944
|
const min = forceColor || 0;
|
|
5209
6945
|
if ('dumb' === env.TERM) return min;
|
|
5210
|
-
if ('win32' ===
|
|
6946
|
+
if ('win32' === external_node_process_["default"].platform) {
|
|
5211
6947
|
const osRelease = external_node_os_["default"].release().split('.');
|
|
5212
6948
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
5213
6949
|
return 1;
|
|
@@ -5454,6 +7190,9 @@ var __webpack_modules__ = {
|
|
|
5454
7190
|
"node:path": function(module) {
|
|
5455
7191
|
module.exports = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__;
|
|
5456
7192
|
},
|
|
7193
|
+
"node:process": function(module) {
|
|
7194
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__;
|
|
7195
|
+
},
|
|
5457
7196
|
"node:tty": function(module) {
|
|
5458
7197
|
module.exports = __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__;
|
|
5459
7198
|
},
|
|
@@ -5941,33 +7680,6 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
5941
7680
|
return getter;
|
|
5942
7681
|
};
|
|
5943
7682
|
})();
|
|
5944
|
-
(()=>{
|
|
5945
|
-
var getProto = Object.getPrototypeOf ? (obj)=>Object.getPrototypeOf(obj) : (obj)=>obj.__proto__;
|
|
5946
|
-
var leafPrototypes;
|
|
5947
|
-
__webpack_require__.t = function(value, mode) {
|
|
5948
|
-
if (1 & mode) value = this(value);
|
|
5949
|
-
if (8 & mode) return value;
|
|
5950
|
-
if ('object' == typeof value && value) {
|
|
5951
|
-
if (4 & mode && value.__esModule) return value;
|
|
5952
|
-
if (16 & mode && 'function' == typeof value.then) return value;
|
|
5953
|
-
}
|
|
5954
|
-
var ns = Object.create(null);
|
|
5955
|
-
__webpack_require__.r(ns);
|
|
5956
|
-
var def = {};
|
|
5957
|
-
leafPrototypes = leafPrototypes || [
|
|
5958
|
-
null,
|
|
5959
|
-
getProto({}),
|
|
5960
|
-
getProto([]),
|
|
5961
|
-
getProto(getProto)
|
|
5962
|
-
];
|
|
5963
|
-
for(var current = 2 & mode && value; 'object' == typeof current && !~leafPrototypes.indexOf(current); current = getProto(current))Object.getOwnPropertyNames(current).forEach((key)=>{
|
|
5964
|
-
def[key] = ()=>value[key];
|
|
5965
|
-
});
|
|
5966
|
-
def['default'] = ()=>value;
|
|
5967
|
-
__webpack_require__.d(ns, def);
|
|
5968
|
-
return ns;
|
|
5969
|
-
};
|
|
5970
|
-
})();
|
|
5971
7683
|
(()=>{
|
|
5972
7684
|
__webpack_require__.d = (exports, definition)=>{
|
|
5973
7685
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
@@ -6044,13 +7756,14 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
6044
7756
|
};
|
|
6045
7757
|
})();
|
|
6046
7758
|
__webpack_require__("./src/runtime/worker/setup.ts");
|
|
7759
|
+
var source_map_support = __webpack_require__("../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js");
|
|
6047
7760
|
var external_node_module_ = __webpack_require__("node:module");
|
|
6048
7761
|
var utils = __webpack_require__("./src/utils/index.ts");
|
|
6049
7762
|
const CoverageProviderMap = {
|
|
6050
7763
|
istanbul: '@rstest/coverage-istanbul'
|
|
6051
7764
|
};
|
|
6052
7765
|
const loadCoverageProvider = async (options, root)=>{
|
|
6053
|
-
const rootPath =
|
|
7766
|
+
const rootPath = pathToFileURL(root).toString();
|
|
6054
7767
|
const moduleName = CoverageProviderMap[options.provider || 'istanbul'];
|
|
6055
7768
|
if (!moduleName) throw new Error(`Unknown coverage provider: ${options.provider}`);
|
|
6056
7769
|
try {
|
|
@@ -6060,7 +7773,7 @@ const loadCoverageProvider = async (options, root)=>{
|
|
|
6060
7773
|
rootPath
|
|
6061
7774
|
]
|
|
6062
7775
|
});
|
|
6063
|
-
const { pluginCoverage, CoverageProvider } = await import(
|
|
7776
|
+
const { pluginCoverage, CoverageProvider } = await import(pathToFileURL(modulePath).toString());
|
|
6064
7777
|
return {
|
|
6065
7778
|
pluginCoverage,
|
|
6066
7779
|
CoverageProvider
|
|
@@ -6175,7 +7888,7 @@ const worker_createRequire = (filename, distPath, rstestContext, assetFiles, int
|
|
|
6175
7888
|
return require;
|
|
6176
7889
|
};
|
|
6177
7890
|
const defineRstestDynamicImport = ({ testPath, interopDefault, returnModule = false })=>async (specifier, importAttributes)=>{
|
|
6178
|
-
const resolvedPath = (0, external_node_path_.isAbsolute)(specifier) ?
|
|
7891
|
+
const resolvedPath = (0, external_node_path_.isAbsolute)(specifier) ? pathToFileURL(specifier) : import.meta.resolve(specifier, pathToFileURL(testPath));
|
|
6179
7892
|
const modulePath = 'string' == typeof resolvedPath ? resolvedPath : resolvedPath.pathname;
|
|
6180
7893
|
if (importAttributes?.with?.rstest) delete importAttributes.with.rstest;
|
|
6181
7894
|
const importedModule = await import(modulePath, importAttributes);
|
|
@@ -6233,7 +7946,7 @@ const loadModule = ({ codeContent, distPath, testPath, rstestContext, assetFiles
|
|
|
6233
7946
|
};
|
|
6234
7947
|
const codeDefinition = `'use strict';(${Object.keys(context).join(',')})=>{`;
|
|
6235
7948
|
const code = `${codeDefinition}${codeContent}\n}`;
|
|
6236
|
-
const fn =
|
|
7949
|
+
const fn = node_vm.runInThisContext(code, {
|
|
6237
7950
|
filename: distPath,
|
|
6238
7951
|
lineOffset: 0,
|
|
6239
7952
|
columnOffset: -codeDefinition.length,
|
|
@@ -6426,7 +8139,7 @@ const processSend = process.send.bind(process);
|
|
|
6426
8139
|
const processOn = process.on.bind(process);
|
|
6427
8140
|
const processOff = process.off.bind(process);
|
|
6428
8141
|
const dispose = [];
|
|
6429
|
-
function createForksRpcOptions(nodeV8 =
|
|
8142
|
+
function createForksRpcOptions(nodeV8 = node_v8) {
|
|
6430
8143
|
return {
|
|
6431
8144
|
serialize: nodeV8.serialize,
|
|
6432
8145
|
deserialize: (v)=>nodeV8.deserialize(Buffer.from(v)),
|
|
@@ -6490,18 +8203,32 @@ class RstestSnapshotEnvironment extends NodeSnapshotEnvironment {
|
|
|
6490
8203
|
return `// Rstest Snapshot v${this.getVersion()}`;
|
|
6491
8204
|
}
|
|
6492
8205
|
}
|
|
8206
|
+
let sourceMaps = {};
|
|
8207
|
+
(0, source_map_support.install)({
|
|
8208
|
+
retrieveSourceMap: (source)=>{
|
|
8209
|
+
if (sourceMaps[source]) return {
|
|
8210
|
+
url: source,
|
|
8211
|
+
map: JSON.parse(sourceMaps[source])
|
|
8212
|
+
};
|
|
8213
|
+
return null;
|
|
8214
|
+
}
|
|
8215
|
+
});
|
|
6493
8216
|
const registerGlobalApi = (api)=>constants.TE.reduce((apis, key)=>{
|
|
6494
8217
|
globalThis[key] = api[key];
|
|
6495
8218
|
return apis;
|
|
6496
8219
|
}, {});
|
|
6497
8220
|
const listeners = [];
|
|
6498
8221
|
let isTeardown = false;
|
|
6499
|
-
const
|
|
8222
|
+
const setupEnv = (env)=>{
|
|
8223
|
+
if (env) Object.assign(process.env, env);
|
|
8224
|
+
};
|
|
8225
|
+
const preparePool = async ({ entryInfo: { distPath, testPath }, updateSnapshot, context })=>{
|
|
6500
8226
|
(0, util.zH)();
|
|
6501
8227
|
context.runtimeConfig = (0, helper.gy)(context.runtimeConfig);
|
|
6502
8228
|
const cleanupFns = [];
|
|
6503
8229
|
const { rpc } = createRuntimeRpc(createForksRpcOptions());
|
|
6504
|
-
const { runtimeConfig: { globals, printConsoleTrace, disableConsoleIntercept, testEnvironment, snapshotFormat } } = context;
|
|
8230
|
+
const { runtimeConfig: { globals, printConsoleTrace, disableConsoleIntercept, testEnvironment, snapshotFormat, env } } = context;
|
|
8231
|
+
setupEnv(env);
|
|
6505
8232
|
if (!disableConsoleIntercept) {
|
|
6506
8233
|
const { createCustomConsole } = await __webpack_require__.e("493").then(__webpack_require__.bind(__webpack_require__, "./src/runtime/worker/console.ts"));
|
|
6507
8234
|
global.console = createCustomConsole({
|
|
@@ -6526,16 +8253,6 @@ const preparePool = async ({ entryInfo: { distPath, testPath }, sourceMaps, upda
|
|
|
6526
8253
|
__webpack_require__.e("655"),
|
|
6527
8254
|
__webpack_require__.e("85")
|
|
6528
8255
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/runtime/api/index.ts"));
|
|
6529
|
-
const { install } = await __webpack_require__.e("969").then(__webpack_require__.t.bind(__webpack_require__, "../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js", 23));
|
|
6530
|
-
install({
|
|
6531
|
-
retrieveSourceMap: (source)=>{
|
|
6532
|
-
if (sourceMaps[source]) return {
|
|
6533
|
-
url: source,
|
|
6534
|
-
map: sourceMaps[source]
|
|
6535
|
-
};
|
|
6536
|
-
return null;
|
|
6537
|
-
}
|
|
6538
|
-
});
|
|
6539
8256
|
listeners.forEach((fn)=>{
|
|
6540
8257
|
fn();
|
|
6541
8258
|
});
|
|
@@ -6636,7 +8353,7 @@ const onExit = ()=>{
|
|
|
6636
8353
|
};
|
|
6637
8354
|
const runInPool = async (options)=>{
|
|
6638
8355
|
isTeardown = false;
|
|
6639
|
-
const { entryInfo: { distPath, testPath }, setupEntries,
|
|
8356
|
+
const { entryInfo: { distPath, testPath }, setupEntries, assets, type, context: { project, runtimeConfig: { isolate } } } = options;
|
|
6640
8357
|
const cleanups = [];
|
|
6641
8358
|
const exit = process.exit.bind(process);
|
|
6642
8359
|
process.exit = (code = process.exitCode || 0)=>{
|
|
@@ -6653,7 +8370,9 @@ const runInPool = async (options)=>{
|
|
|
6653
8370
|
process.once('SIGTERM', onExit);
|
|
6654
8371
|
};
|
|
6655
8372
|
if ('collect' === type) try {
|
|
6656
|
-
const { rstestContext, runner, cleanup, unhandledErrors, interopDefault } = await preparePool(options);
|
|
8373
|
+
const { rstestContext, runner, rpc, cleanup, unhandledErrors, interopDefault } = await preparePool(options);
|
|
8374
|
+
const { assetFiles, sourceMaps: sourceMapsFromAssets } = assets || await rpc.getAssetsByEntry();
|
|
8375
|
+
sourceMaps = sourceMapsFromAssets;
|
|
6657
8376
|
cleanups.push(cleanup);
|
|
6658
8377
|
await loadFiles({
|
|
6659
8378
|
rstestContext,
|
|
@@ -6685,6 +8404,8 @@ const runInPool = async (options)=>{
|
|
|
6685
8404
|
const { rstestContext, runner, rpc, api, cleanup, unhandledErrors, interopDefault } = await preparePool(options);
|
|
6686
8405
|
const coverageProvider = await createCoverageProvider(options.context.runtimeConfig.coverage || {}, options.context.rootPath);
|
|
6687
8406
|
if (coverageProvider) coverageProvider.init();
|
|
8407
|
+
const { assetFiles, sourceMaps: sourceMapsFromAssets } = assets || await rpc.getAssetsByEntry();
|
|
8408
|
+
sourceMaps = sourceMapsFromAssets;
|
|
6688
8409
|
cleanups.push(cleanup);
|
|
6689
8410
|
await loadFiles({
|
|
6690
8411
|
rstestContext,
|
|
@@ -6699,14 +8420,6 @@ const runInPool = async (options)=>{
|
|
|
6699
8420
|
onTestFileStart: async (test)=>{
|
|
6700
8421
|
await rpc.onTestFileStart(test);
|
|
6701
8422
|
},
|
|
6702
|
-
onTestFileResult: async (test)=>{
|
|
6703
|
-
if (coverageProvider) {
|
|
6704
|
-
const coverageMap = coverageProvider.collect();
|
|
6705
|
-
if (coverageMap) test.coverage = coverageMap.toJSON();
|
|
6706
|
-
coverageProvider.cleanup();
|
|
6707
|
-
}
|
|
6708
|
-
await rpc.onTestFileResult(test);
|
|
6709
|
-
},
|
|
6710
8423
|
onTestCaseResult: async (result)=>{
|
|
6711
8424
|
await rpc.onTestCaseResult(result);
|
|
6712
8425
|
}
|
|
@@ -6715,6 +8428,11 @@ const runInPool = async (options)=>{
|
|
|
6715
8428
|
results.status = 'fail';
|
|
6716
8429
|
results.errors = (results.errors || []).concat(...(0, util.o9)(unhandledErrors));
|
|
6717
8430
|
}
|
|
8431
|
+
if (coverageProvider) {
|
|
8432
|
+
const coverageMap = coverageProvider.collect();
|
|
8433
|
+
if (coverageMap) results.coverage = coverageMap.toJSON();
|
|
8434
|
+
coverageProvider.cleanup();
|
|
8435
|
+
}
|
|
6718
8436
|
return results;
|
|
6719
8437
|
} catch (err) {
|
|
6720
8438
|
return {
|