Open Gozala opened 11 years ago
Source map support for strings and numbers has landed as string and number primitives now are read as String
and Number
instances.
Although booleans and nil are still unsupported. One idea that may work out would be to read primitive forms like
applications (boolean true)
, (boolean false)
, (and nil)
that way they'll be lists to which metadata could be attached, at
the same time they will evaluate as expected in macros.
In fact it would be easier to read all the primitives as:
(quote true)
(quote false)
(quote nil)
(quote 5)
(quote "hello")
Location information currently is stored in metadata, but since metadata can be added on primitive values location information is missing on them causing inaccurate source mapping.
I can see few ways to fix that:
String
Number
etc.. instances instead of primitives, in which case metadata could be attached. This is going work but will be very JS specific solution I'm afraid, alsonil
will require some special treatment.