4 Commits
Author SHA1 Message Date
Alexander KireyevandGitHub 64117f22bc Fix Input#origin() mixing null and undefined for unmapped end position (#2106)
When the requested end position has no mapping in the source map,
originalPositionFor() returns an object with line/column set to null
rather than omitting them. endLine picked that null up correctly, but
endColumn was computed as `to && to.column + 1`, which due to operator
precedence is `to && (to.column + 1)`, turning null into 1. So callers
could get back { endColumn: 1, endLine: null }, which doesn't match
how every other unmapped case in this function behaves (undefined for
both). Looks like the +1 fix in #2036 covered the mapped case but not
this one.

Guard `to` the same way `from` already is, so an unmapped end position
just stays undefined.
2026-06-30 23:14:26 +02:00
Andrey Sitnik fb2bc3f358 Update formatting 2026-06-28 14:54:32 +00:00
mizdraandGitHub aef1148997 Fix Input#origin() returning incorrect position (#2036)
* Add missing `test.run()`

* Fix `Input#origin()` returning incorrect position

* Refactor test with source-map-js
2026-06-28 16:53:40 +02:00
mizdraandGitHub 676f35fe97 Add Input#fromLineAndColumn, CssSyntaxError.input.offset and CssSyntaxError.input.endOffset (#2034)
* Test the current behavior of error location

* Fix missing jsdoc for `Input#error(message, start, end, opts)`

* Refactor `fromOffset`

* Add `Input#fromLineAndColumn`

* Add `Input#offset` and `Input#endOffset`

* Convert `_getLineToIndex` to function
2025-03-22 18:08:32 +01:00