[K/JS] Remove the possibility to have negative lines and columns in Source Maps
This commit is contained in:
@@ -1395,4 +1395,16 @@ fun IrFunction.getAdapteeFromAdaptedForReferenceFunction() : IrFunction? {
|
||||
if (call is IrReturnableBlock) return (call.inlineFunctionSymbol ?: unknownStructure()).owner
|
||||
if (call !is IrFunctionAccessExpression) { unknownStructure() }
|
||||
return call.symbol.owner
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The method is used to calculate the previous offset from the current one to prevent situations when it can calculate
|
||||
* [UNDEFINED_OFFSET] from 0 offset and -2 offset from the [UNDEFINED OFFSET]
|
||||
*/
|
||||
val Int.previousOffset
|
||||
get(): Int =
|
||||
when (compareTo(0)) {
|
||||
0 -> 0
|
||||
-1 -> UNDEFINED_OFFSET
|
||||
else -> minus(1)
|
||||
}
|
||||
Reference in New Issue
Block a user