fix(source-maps): adjusted error line and made variables more descritive

This commit is contained in:
Gabriel Grubba
2022-08-11 14:44:37 -03:00
parent a946955445
commit 6b7342cbd6

View File

@@ -1,7 +1,6 @@
var selftest = require('../tool-testing/selftest.js');
var Sandbox = selftest.Sandbox;
var files = require('../fs/files');
var catalog = require('../packaging/catalog/catalog.js');
function matchPath (text, doubleBS) {
if (process.platform === 'win32') {
@@ -17,9 +16,11 @@ selftest.define("source maps from checkout", ['checkout'], function () {
try {
throw new Error();
} catch (e) {
// this refers to the line number where the error is thrown
const errorLine = "17";
var index = (process.platform === 'win32') ? 2 : 1;
const sourceMap = e.stack.split(":")[index];
const result = (sourceMap === "17" || sourceMap === "18");
const result = (sourceMap === errorLine);
selftest.expectEqual(result, true);
}
});