Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.sh text eol=lf
.gitattributes text eol=lf
21 changes: 21 additions & 0 deletions example.ts
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
console.log('Some .ts code reproducing a bug');
/* some comment */
function someFunc() {
throw new Error("Error2 "); // Line 4
}
; (() => {
try {
/* some comment */
someFunc(); // Line 9
}
catch (err) {
/* some comment */
// console.log("Error Found", err);

const a = err.stack.split("\n").filter(x => x.match(/example.ts/));
const lineNumbers = a.map((x) => parseInt(x.match(/\:([0-9]+)/)[1], 10));
console.log(lineNumbers);
if (lineNumbers.join(",") !== "4,9,22") {
throw new Error("Invalid line number : expecting 4,9,22 and got " + lineNumbers.join(","));
}
}
})(); // Line 22
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"dependencies": {
"ts-node": "latest",
"typescript": "latest"
"typescript": "^3.9.3"
}
}
6 changes: 4 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
n lts

# Install package.json dependencies
yarn
npm install

# Run ts-node
yarn ts-node ./example.ts
npx [email protected] example.ts

npx [email protected] example.ts

echo "Process exited with code: $?"
echo
Expand Down