docs/adr/00003-reserve-bytepos-0-for-dummy-span.md
BytePos(0) for dummy spansBytePos(0) was causing lots of problems because a span generated for user input can have BytePos(0).
We tried various ways to distinguish the user input from synthesized spans, but all were not successful.
It especially caused various issues on source maps.
BytePos(0).SourceMap each time we create one.Reserving 0 of BytePos provides guarantee which can be used by various codegen crates.
As BytePos(0) is reserved, swc_ecma_codegen can know if a BytePos is dummy without checking both of lo and hi.
BytePos is dummy become easier.SourceMap each time we create one.This is a code smell, and if we select this, we can't depend on the fact BytePos(0) is dummy.