Closed jordwalke closed 1 year ago
This site is really good for debugging issues visually: http://sokra.github.io/source-map-visualization/#custom
Also, OCaml locations are bytes based where sourcemap seems to expect code-point based.
https://github.com/ocaml/ocaml/issues/11899
https://github.com/terser/terser/issues/960
While modifying
parse_bytecode.ml
for rehp, I might have stumbled upon some evidence thatparse_bytecode.ml
is responsible for source maps being difficult to use in practice (they jump all over the place in very unintuitive ways).Problem: For the following Reason code:
We get the following debug data: (Notice the many things claiming to be on line
4
that aren't! For example_g_
(the number30
))But if you add the following print statements right after this line in
parse_bytecode.ml
You will see that there are only two debug events for line4
, (likely the correct lineprint_endline(greeting)
)