-
-
Save ftsf/40ba9cbb8aa6c58bcafa8c221751244e to your computer and use it in GitHub Desktop.
Broken behaviour in JS codegen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # broken in js | |
| var frontier = newHeap[FrontierElem[Tile, float32]](frontiercmp) do (a, b: FrontierElem[Tile, float32]) -> int: | |
| return cmp(a.priority, b.priority) | |
| # error: | |
| Uncaught ReferenceError: colonanonymouse__223267 is not defined | |
| however it works correctly when compiled to C. | |
| # workaround for js | |
| proc frontiercmp(a,b: FrontierElem[Tile, float32]): int = | |
| return cmp(a.priority, b.priority) | |
| var frontier = newHeap[FrontierElem[Tile, float32]](frontiercmp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment