HaxeFoundation / HaxeFoundation/haxe

hxb vs. exception stack positions (I think)

Open
#12,205 3 comments 0 reactions 0 assignees View on GitHub
feature-hxb
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
import haxe.exceptions.NotImplementedException;

function throwing() {
throw new NotImplementedException();
}

function syncFun2() {
throwing();
}

function syncFun1() {
syncFun2();
}

function main() {
try {
syncFun1();
} catch(e:NotImplementedException) {
trace(e.stack);
}
}
```

```
PS C:\git\haxerepro> haxe -cp source --main Main --jvm export/run.jar --hxb export/run.hxb
PS C:\git\haxerepro> java -jar export/run.jar
source/Main.hx:19:
Called from _Main.Main_Fields_.throwing (source/Main.hx line 4)
Called from _Main.Main_Fields_.syncFun2 (source/Main.hx line 8)
Called from _Main.Main_Fields_.syncFun1 (source/Main.hx line 12)
Called from _Main.Main_Fields_.main (source/Main.hx line 17)
Called from _Main.Main_Fields_.main (source/Main.hx line 0)
PS C:\git\haxerepro> haxe --hxb-lib export/run.hxb --main Main --jvm export/run.jar
PS C:\git\haxerepro> java -jar export/run.jar
source/Main.hx:19:
Called from _Main.Main_Fields_.throwing (source/Main.hx line -1)
Called from _Main.Main_Fields_.syncFun2 (source/Main.hx line -1)
Called from _Main.Main_Fields_.syncFun1 (source/Main.hx line -1)
Called from _Main.Main_Fields_.main (source/Main.hx line -1)
Called from _Main.Main_Fields_.main (source/Main.hx line 0)
```

I don't know the scope of this yet but we're somehow losing positions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.