<< Back to previous view

[CLJS-706] Source map column mapping is off by one Created: 28/Nov/13  Updated: 29/Nov/13  Resolved: 29/Nov/13

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Nelson Morris Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File dec_column.patch    
Patch: Code

 Description   

tools.reader uses 1 for the starting index of the line and columns.

`(meta (reader/read (readers/source-logging-push-back-reader (java.io.PushbackReader. (java.io.StringReader. "+")))))
=> {:end-column 1, :end-line 1, :column 1, :line 1, :source "+"}`

Sourcemaps use 0 for the starting index. So we need to decrement the :column as well as the :line when making the sourcemap map. Also, the comment regarding line numbers and 0- vs 1- indexing is reversed.



 Comments   
Comment by David Nolen [ 29/Nov/13 10:34 AM ]

fixed, https://github.com/clojure/clojurescript/commit/cd18069e6acaf6b878b43e2474b1e45dcf105767

Generated at Thu Dec 18 14:24:09 CST 2014 using JIRA 4.4#649-r158309.