Just offset by the initial quote character

... dividing by two yields bogus offsets for multi-character
adjustments, leading to invalid sourcemaps with negative column
positions
This commit is contained in:
Gunnlaugur Þór Briem 2013-09-24 18:14:53 +00:00
parent 9b38b16701
commit fe819011e2

View File

@ -315,7 +315,7 @@ function OutputStream(options) {
// Fixes offsets for quoted keys of object literals
remainder = token.endpos - token.pos - tokenName.length;
offset = remainder === 0 ? 0 : remainder/2;
offset = remainder === 0 ? 0 : 1;
}
options.source_map.add(